SetFile.1   [plain text]


.\" Copyright (c) 2001 Apple Computer, Inc. All Rights Reserved.
.Dd March 24, 2001
.Dt SETFILE 1
.Os Darwin
.Sh NAME
.Nm SetFile
.Nd set attributes of HFS+ files
.Sh SYNOPSIS
.Nm
.Op Fl a Ar attributes 
.Op Fl c Ar creator 
.Op Fl d Ar date 
.Op Fl m Ar date 
.Op Fl t Ar type 
file ...
.Sh DESCRIPTION
.Nm
is a tool to set the file attributes on files in an HFS+ directory. It attempts to be similar to the
.Nm setfile
command in MPW. It can apply rules to more than one file with the options applying to all files listed.
.Pp
Flags:
.Bl -tag -width "-a attributes" -indent
.It Fl a Ar attributes
Sets the file attributes bits where
.Ar attributes 
is a string of case sensitive letters. Each letter corresponds to a file attribute: an uppercase letter indicates that the atribute bit is set (1), a lowercase letter indicates that it is not (0).
.Nm Note:
.Ar attributes 
not specified remain unchanged.
.Bl -tag -width -indent
.It A | a 
Alias file
.It B | b 
Has bundle
.It C | c 
Custom icon (allowed on folders)
.It D | d 
Located on the desktop (allowed on folders)
.It I | i
Inited - Finder is aware of this file and has given it a location in a window. (allowed on folders)
.It L | l 
Locked
.It M | m 
Shared (can run multiple times)
.It N | n
File has no INIT resource
.It S | s 
System file (name locked)
.It T | t 
Stationary file
.It V | v 
Invisible (allowed on folders)
.El
.It Fl c Ar creator 
Specifies the file's creator, where
.Ar creator
is a sting of exactly four characters.
.It Fl d Ar date 
Sets the creation date, where
.Ar date
is a string of the form: "mm/dd/[yy]yy [hh:mm:[:ss] [AM | PM]]"
.Nm Notes:
Enclose the string in quotation marks if it contains spaces. Period '.' represents the current date and time. [yy]yy < 100 assumes 20th century, e.g.19yy. 
.It Fl m Ar date 
Sets the modification date where
.Ar date
is a string of the form in 
.Fl d 
above. (mm/dd/[yy]yy [hh:mm:[:ss] [AM | PM]])
.It Fl t Ar type 
Sets the file type, where 
.Ar type
is a string of exactly four characters.
.El
.Sh RETURN VALUES
.Bl -tag -compact -width -indent
.It Nm 0 
attributes set
.It Nm 1
syntax error
.It Nm 2 
any other error
.El
.Sh EXAMPLES 
The following command line sets the creator and type for the 
.Nm ResEqual
tool:
.Pp
SetFile ResEqual -c "MPS " -t MPST
.Pp
This command line sets the modification date of "myFile":
.Pp
SetFile myFile -m "8/4/2001 16:13"