![]() |
![]() |
![]() |
|
![]() | |
![]() |
![]() |
![]() |
![]() |
![]() |
Log In | Not a Member? |
Support
![]() |
![]() |
SYNTAX
Files [name1] [name2]
[-af] [-c creator] [-d | -s] [-f] [-fr] [-i] DESCRIPTION The Files command returns information on one or more directories or files by listing the contents of directories and the requested fields of information for files. If you do not specify any directories or files, Files lists the contents of the current directory. INPUT None OUTPUT Standard output. For each directory specified, Files generates a list (in alphabetical order) of all subdirectories, followed by all files. For each file specified, the command writes only the name of the specified file unless you specify information fields. (See -l and -x.) ALIAS RESOLUTION This command resolves embedded Finder aliases in all input file pathname specifications; leaf aliases are not resolved in input paths. Two options (-fr and -af) allow you to change this default behavior. STATUS
Files can return the following status codes:
PARAMETERS name1 [name2] Specifies one or more directories and files. If you omit this parameter, Files lists the contents of the current directory. OPTIONS -af Resolves folder aliases; that is, it causes folder aliases to be treated as folders. If you specify a folder alias on the command line, this option causes Files to list the contents of the directory as if you had specified the actual path of the directory instead of a folder alias. Note that you cannot specify this option with the recursive (-r) option. -c creator Lists only those files with the given file creator. -d Lists subdirectories only. Normally Files lists both subdirectories and files. Note that you cannot use this option in conjunction with -s. -f Writes the full pathname of all files listed. -fr Writes the full pathname of all files listed. All aliases are resolved before expanding the path. -i Treats all items in the name1 [name2] parameter as files, writing their names and any requested information fields. (Use -l or -x to specify the fields.) Normally Files writes only the contents of directories. -l Lists files in a lengthened format, displaying the following information for each file: name, type, creator, size, flags, last modification date, and creation date. The fifth field of information, flags, displays other file attributes as a string of letters. Each letter is a flag: an uppercase letter indicates that the attribute is set; a lowercase letter indicates that it is not set.
The flags (listed in display order) and their meanings when set follow:
Note -m column Specifies the number of columns of output, where column is any number. Do not use this option in conjunction with -l or -x. -n Suppresses the header in the lengthened (-l) or extended (-x) format. The header contains field titles labeling the information displayed in the columns below. Use this option in conjunction with either -l or -x. -o Writes only the contents of the directories, not the directory names themselves. Normally each directory name is written above its contents. -q Inhibits quoting file or directory names. Normally Files quotes names that contain spaces or special characters. -r Lists all subfolders recursively, causing Files to list every file in every directory. Normally Files lists subdirectories and files only one layer deep. -s Suppresses the writing of directory names. Use this option, for example, in conjunction with -r to get a listing of all files, excluding directories. Note that you cannot use this option in conjunction with -d. -t type Lists only files of the given type. -x format
Lists files (-i) or directories in an extended format, displaying the requested fields of information for each. This option generates a listing similar to that produced by -l, except that the fields to be written are determined by format
, where format
is a string composed of one or more of the following letters:
Note -y4 Displays years using 4 digits. EXAMPLES Executing the Files command without any parameters displays the contents of the current directory. For example, if Examples:ProjectorExamples is the current directory, the command line Files produces the output
:Commands: The command line Files -r -s -f recursively lists the contents of the current directory, giving full pathnames of all files. Directory names are suppressed.
HD:source:defs.h The command line Files -d lists only the directories in the current directory. Notice that Files -d lists only the first level of directories. You must use -r to list subdirectories and files. In the following example, Files lists the size and creation date of the {MyIncludes} directory. Files -i -x kd "{MyIncludes}" The output appears as follows. Notice how -i is used to avoid writing the contents of the directory. Name Size Creation-Date ---------------------------- ------ ---------------- HD:Sources:MyIncludes: 365K 8/25/96 9:32 AM
|