• Keine Ergebnisse gefunden

Accessing Files and Directories

Im Dokument User's Guide and Reference OSF DCE (Seite 110-113)

Accessing Data in DFS

6.2 Accessing Files and Directories

When working with files and directories in DFS, you use standard operating system commands such as Is and cd to list files and change directories. The difference is that, in DFS, you can access much more data because you are not limited to just those files and directories on your local disk. As in any file system, you can access only those files and directories for which you have permission.

In DFS, the permissions associated with a DCE LFS file or directory are set using DCE Access Control Lists (ACLs). (Permissions are set for non-LFS files and directories with the standard operating system mode bits.) DFS uses a specific implementation of DCE ACLs. See Part IB of this book for complete details about using DCE ACLs. See Chapter 7 for information about using ACLs to limit access to files and directories in DFS.

To access files and directories in a DCE cell, you must

• Be authenticated to DCE

• Specify correct pathnames

• Have access to the desired files and directories based on the ACLs associated with them

In any file system, if multiple users modify the same file at the same time, the changes last saved are the changes you see, regardless of who modified the file. When working with someone on the same files, make sure you coordinate your work so you do not overwrite each other's changes. You can also use ACLs to limit access to your files and directories, preventing other users from accidentally overwriting your files.

6.2.1 Changing to a Different Directory

6-4

In DFS, standard operating system commands are used to change directories. Changing directories involves moving from the current working directory to a different directory. The current working directory is the directory in which you are presently located. When using the UNIX operating system with DFS, you can use the pwd command to display the full pathname of the current working directory on the screen.

For example, if the user terry is from the abc.com cell, terry's home directory can have a name like I .. ./abc.com/fs/usr/terry. In the UNIX operating system, if terry's current working directory is terry's home directory, terry can issue the pwd command to display output similar to the following:

%pwd

/ ... /abc.com/fs/usr/terry

In the UNIX operating system, the cd command is used to change directories. When changing directories, the notion of a parent directory can be used to shorten the pathname required with the command. A directory's parent directory is the directory in which it resides (the directory located immediately above it in the file system hierarchy).

For example, the directory named I •. ./abc.comlfs/usr/terry/public is located beneath, or in, the directory named I .• ./abc.comlfs/usr/terry.

Therefore, the directory named terry is the parent directory of the directory named public. terry's home directory, the following UNIX commands are equivalent:

% cd I .. ./abc.comlfs/usr/terry/public

% cd public

In the UNIX operating system, terry can issue the cd command without a pathname to return to the home directory from the public directory or from DeE User's Guide and Reference

any directory anywhere in the file system. When issued without a pathname argument, the cd command returns users to their home directories.

6.2.2 Listing the Contents of a Directory

Standard operating system commands are also used in DFS to list the contents of a directory. Listing a directory displays the names of all of the files and directories located in that directory. Listing a directory does not display the contents of any subdirectories (directories located in the directory being listed).

To list the contents of a directory in the UNIX operating system, enter the Is command with the pathname for the directory. The following example uses the Is command to list the files and directories located in the directory other things, each subdirectory in a directory. If the -F option is included, a / (slash) is displayed after the name of each subdirectory. For example, the same command issued with the -F option produces the following outp~t:

% Is -F / .. Jabc.comlfs/usr/terry/public finance.memo

finance. text

nUsc. text purchasing/

purchasing.memo

Note that purchasing now has a slash after its name in the output to identify it as a directory. Also· note that in both examples the contents of the purchasing directory are not displayed when its parent directory, public, is listed.

You can also use the cd command to change to a directory and then issue the Is command to list the contents of the directory without specifying the directory's name. When issued without a pathname argument, the Is

6.2.3 Using Name Prefixes in Commands

When issuing commands in DFS, you can also use I.: (the cell-relative prefix) and I: (the DFS-relative prefix) if the system administrator for your cell has enabled them. For example, t~e following commands use the two abbreviations to execute the PNIX cd and Is commands displayed in the previous sections. When issued from the local cell, the following three cd commands are equivalent:

% cd 1 .. .Iabc.comlfs/usr/terry/public

% cd 1.:/fs/usr/terry/public

% cd 1:/usr/terry/public

Similarly, when issued from the local cell, the following three Is commands are equivalent:

% Is 1 •. .Iabc.comlfs/usr/terry/public

% Is 1.:/fs/usr/terry/public

% Is 1:/usr/terry/public

Im Dokument User's Guide and Reference OSF DCE (Seite 110-113)