 |
» |
|
|
 |
The
ftam program allows you to manipulate the remote host's file system.
You can change your current working directory at the remote host;
delete, rename, and change the attributes of remote files; and create,
rename, and delete directories on the remote host (however, see
the following section on directory support). Table 2-3 “ftam Directory Operations
Commands” lists commands that allow you to work
with remote files. See "Notes About Remote File and Directory
Names" earlier in this chapter for guidelines on specifying
remote names. The exact effect of the commands in Table 2-3 “ftam Directory Operations
Commands” may depend on the level of support the
responder provides for directories. See "Directory Support
in FTAM Implementations" later in this chapter. Table 2-3 ftam Directory Operations
Commands Command | Function |
|---|
pwd | Prints
the name of the current remote working directory. The resulting
name uses the syntax and conventions of the remote host. Example:
ftam> pwd | cd
directory | Changes
the current remote working directory. This example shows proper
syntax for a remote HP-UX host. Example: ftam> cd project7/datafiles | ls
[-a] [name]
[file] | If
the name argument is a directory, ls lists the files it contains;
the default is the remote working directory. If the name argument
is a file, ls displays the file name if it exists. If the file argument
is given, the output from the command is placed in a file by the
specified name.The -a option generates a complete listing of all
the FTAM attributes of the file or files (see example following
this table). | dir
[name] [file] | If
the name argument is a directory, dir shows a "summary"
listing of the files the directory contains; the default is the
remote working directory. If the name argument is a file, dir displays
a summary listing of the file if it exists. If the file argument
is given, the output from the command is placed in a file by the
specified name. The listing includes the file name(s), and several
important attributes for each file (see example following this table). | rename
from to | Changes
the name of a remote file. Example: ftam> rename tmp1 save | delete
file | Removes
a remote file. Example: ftam> delete junkfile | mdelete
files (Multiple-delete) | Removes
multiple remote files. "Wildcard" file specification
is not allowed. Example: ftam> mdelete tmp1 tmp2 | mkdir
directory | Creates
a directory on the remote host. Example: ftam> mkdir newdir | rmdir
directory | Deletes
a remote directory. The directory must be empty. Example: ftam> rmdir tempdir | cattr
remote_file -dfilnsv
new-attr [-dfilnsv
new-attr] ... | Change
the FTAM attributes of a remote file. See the section called "Using
the cattr Command" following this table. The following
example uses cattr to rename a file. Example: ftam> cattr currentfile -n historyfile |
File Listings from FTAM |  |
The following example illustrates
the different kinds of file listings that are available. $ ftam ftam> open chicago Username (chicago:alan): donald Password (chicago:donald): Connected to chicago as user donald. |
ftam> pwd Name of default working directory on chicago is unavailable. ftam> cd /users/donald/reports /users/donald/reports is the current working directory.
|
ftam> ls fn_1gfs fn_1gnl fn_1gns fn_2m fn_2s fn_3m fn_3s ftamdir ftam> ls -a fn_1gns Filename: /users/donald/reports/fn_1gns Permissions: R-PXEACD--- File type: text (FTAM-1) Storage account: no value available File creation: no value available Last file modification: Apr 21 19:49 Last read: May 18 15:36 Last attribute modification: no value available Identity of creator: donald Identity of modifier: no value available Identity of reader: no value available Identity of attribute modifier: no value available File availability: deferred availability Filesize: 1100 Access Control: other R-PXEACD group R-PXEACD user R-PXEACD Legal qualification: no value available |
 |
 |
ftam> dir /users/donald/reports: Permissions Owner File type Filesize Access date Filename ---------------------------------------------------------------------- R-PXEACD--- donald text (FTAM-1) 1920 Apr 21 19:49 fn_1gfs R-PXEACD--- donald text (FTAM-1) 250000 Apr 21 19:51 fn_1gnl R-PXEACD--- donald text (FTAM-1) 1100 Apr 21 19:49 fn_1gns RI--EACD--- donald text (FTAM-2) 20020 Apr 21 19:50 fn_2m RI--EACD--- donald text (FTAM-2) 3001 Apr 21 19:50 fn_2s R-PXEACD--- donald binary (FTAM-3) 39999 Apr 21 19:50 fn_3m R-PXEACD--- donald binary (FTAM-3) 5000 Apr 21 19:50 fn_3s R----ACD--- donald dir (NBS-9) 1024 May 09 12:13 ftamdir ftam> |
Permissions are described in the first table of chapter 5
(Table 5-1 “Possible File Actions”). Using the cattr Command |  |
The FTAM specification defines many attributes that describe an FTAM file. The
cattr command gives you the ability to modify many of these attributes
for a file. To change the attributes of a file, you must at least
have FTAM change_attribute permission on the
file. The cattr command can perform the actions in Table 2-4 “cattr Actions and Command
Options”. Use the associated cattr command option
to request an action. Syntax of the cattr CommandThe syntax for the cattr command
is as follows: cattr -dinflsv new_attribute [-dinflsv new_attribute] ... file |
The cattr command always works on files in the remote filestore
you are connected to. You can use one or more options in a command
(one at a time, each followed by its argument). See Table 2-4 “cattr Actions and Command
Options” and the examples that follow it. Table 2-4 cattr Actions and Command
Options Action | Command Option | Option
Argument |
|---|
Delete an element from the file's access
control list. (File protection is discussed in chapter 5.) | -d | For
HP-UX responders, this must be user, group, or other. | Insert an element into the file's access
control list. (File protection is discussed in chapter 5.) | -i | For
HP-UX responders, this must be user, group, or other, followed by
a comma, followed by an "action/concurrency string"
(see chapter 5). | Change the name of the file | -n | New
file name (Character string) | Change maximum permitted size of the file* | -f | New
size (integer, octets) (Numeric string) | Change the file's legal qualification* | -l | New
legal qualification (Character string) | Change the file's storage account* | -s | New
account (Character string) | Change
the file availability* | -v | -v I or
-v i :Immediate -v d or -v D :Deferred |
* HP FTAM/9000 does not keep track of this attribute
for local files. The option is for use with other FTAM responders. This example illustrates
how to rename a remote file using cattr. The file called oldfile
is renamed to newfile. ftam> cattr oldfile -n newfile |
This example adds access control for the file's owner, allowing
all actions. It also allows group members to have read and read_attribute
permissions: ftam> cattr /ftamfiles/report -i user,RPXEACD -i group,RA |
This example removes the access control placed on the file
in the previous example: ftam> cattr /ftamfiles/report -d user -d group |
This example changes the account to region1sales and future
filesize to 2,000,000 ftam> cattr atlanta:marketing.sales -s region1sales -f 2000000 |
Directory Support in FTAM Implementations |  |
The behavior of some directory commands depends on the remote
system.
[3] Some remote FTAM implementations
might not support the concept of directories, but others, like HP
FTAM/9000, do. Table 2-5 “Effect of Directory Support
on ftam Commands” explains
the effect of different levels of support for directories: Table 2-5 Effect of Directory Support
on ftam Commands Command | If remote system supports the concept
of directories, ... | If
remote system does not support the concept of directories, ... |
|---|
cd | Works as described previously. Invalid
directory names are detected as soon as you issue the cd command. | The
directory name you supply to the cd command becomes a prefix, which
ftam attaches to subsequent file names before it relays them to
the remote host. If the directory name is invalid at the remote
host, the error is not detected until you attempt to access a remote
file. | pwd | The command returns the current working
directory for the remote system. If you have not yet used cd, ftam
can not obtain the name of the current working directory. | The
command returns the name you specified in your last cd command.
This name could be invalid. If you have not yet used cd, ftam can
not obtain the name of the current working directory. | ls
dir mkdir rmdir | These
commands work as describ-ed previously. Invalid directory
names are detected as soon as you issue the command. | These commands
do not work. You receive an error message. |
|