Intel XENIX 286 Programmers Guide (86) - Tenox.tc

Intel XENIX 286 Programmers Guide (86) - Tenox.tc Intel XENIX 286 Programmers Guide (86) - Tenox.tc

09.06.2013 Views

XENIX Programming sees: Source Code Control System Creating an s-file You can create an s-file from an existing text file using the -i (for "initialize") option of the admin command. The command has the form admin -ifilename s. filename where -ifilename gives the name of the text file from which the s-file is to be created, and s.filename is the name of the new s-file. The name must begin with s. and must be unique; no other s-file in the same directory may have the same name. For example, suppose the file named demo.c contains the short C language program #include main () { printf("This is version 1.1 \n"); } To create an s-file, type admin -idemo.c s.demo.c This command creates the s-file s.demo.c and copies the first delta describing the contents of demo.c to this new file. The first delta is numbered 1.1. After creating an s-file, the original text file should be removed using the rm command. It is no longer needed. If you wish to view the text file or make changes to it, you can retrieve the file using the get command described in the next section. When you are first creating an s-file, the admin command may display the warning message No id keywords (cm7) In general, this message can be ignored unless you have specifically included keywords in your file (see the section "Using Identification Keywords" later in this chapter). Note that only a user with write permission in the directory containing the s-file may use the admin command on that file. This protects the file from adm inistration by unauthorized users. Retrieving a File for Reading You can retrieve a file for reading from a given s-file by using the get command. The command has the form get s.filename • • . 5-5

SCCS: Source Code Control System XENIX Programming where s.filename is the name of the s-file containing the text file. The command retrieves the lastest version of the text file and copies it to a regular file. The file has the same name as the s-file but with the s. removed. It also has read-only file permissions. For example, suppose the s-file s.demo.c contains the first version of the short C program shown in the previous section. To retrieve this program, type get s.demo.c The command retrieves the program and copies it to the file named demo.c. You may then display the file just as you do any other text file. The command also displays a message that describes the SID of the retrieved file and its size in lines. For example, after retrieving the short C program from s.demo.c, the command displays the message 1. 1 6 lines You may also retrieve more than one file at a time by giving multiple s-file names in the command line. For example, the command get s.demo.c s.def.h retrieves the contents of the s-files s.demo.c and s.def.h and copies them to the text files demo.c and def.h. Multiple s-file names in a command must be separated by spaces or tabs. When the get command displays information about the files, it places the corresponding file name before the relevant information. Retrieving a File for Editing You can retrieve a file for editing from a given s-file by using the -e (for "editing") option of the get command. The command has the form get -e s. filename • • • where s.filename is the name of the s-file containing the text file. You may give more than one file name if you wish. If you do, you must separate the names with spaces or tabs. get retrieves the latest version of the text file and copies it to an ordinary text file. The file has the same name as the s-file but with the s. removed. It has read and write file permissions. For example, suppose the s-file s.demo.c contains the first version of a C program. To retrieve this program, type get -e s.demo.c The command retrieves the program and copies it to the file demo.c. You may edit the file just as you do any other text file. If you give more than one file name, the command creates files for each corresponding s-file. Since the -e option applies to all the files, you may edit each one. 5-6

SCCS: Source Code Control System <strong>XENIX</strong> Programming<br />

where s.filename is the name of the s-file containing the text file. The command<br />

retrieves the lastest version of the text file and copies it to a regular file. The file has<br />

the same name as the s-file but with the s. removed. It also has read-only file<br />

permissions. For example, suppose the s-file s.demo.c contains the first version of the<br />

short C program shown in the previous section. To retrieve this program, type<br />

get s.demo.c<br />

The command retrieves the program and copies it to the file named demo.c. You may<br />

then display the file just as you do any other text file.<br />

The command also displays a message that describes the SID of the retrieved file and its<br />

size in lines. For example, after retrieving the short C program from s.demo.c, the<br />

command displays the message<br />

1. 1<br />

6 lines<br />

You may also retrieve more than one file at a time by giving multiple s-file names in<br />

the command line. For example, the command<br />

get s.demo.c s.def.h<br />

retrieves the contents of the s-files s.demo.c and s.def.h and copies them to the text<br />

files demo.c and def.h. Multiple s-file names in a command must be separated by spaces<br />

or tabs. When the get command displays information about the files, it places the<br />

corresponding file name before the relevant information.<br />

Retrieving a File for Editing<br />

You can retrieve a file for editing from a given s-file by using the -e (for "editing")<br />

option of the get command. The command has the form<br />

get -e s. filename •<br />

• •<br />

where s.filename is the name of the s-file containing the text file. You may give more<br />

than one file name if you wish. If you do, you must separate the names with spaces or<br />

tabs.<br />

get retrieves the latest version of the text file and copies it to an ordinary text file. The<br />

file has the same name as the s-file but with the s. removed. It has read and write file<br />

permissions. For example, suppose the s-file s.demo.c contains the first version of a C<br />

program. To retrieve this program, type<br />

get -e s.demo.c<br />

The command retrieves the program and copies it to the file demo.c. You may edit the<br />

file just as you do any other text file.<br />

If you give more than one file name, the command creates files for each corresponding<br />

s-file. Since the -e option applies to all the files, you may edit each one.<br />

5-6

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!