SETFILE(1)

NAME
SetFile - set attributes of HFS+ files

SYNOPSIS
SetFile [-a attributes] [-c creator] [-d date] [-m date] [-t type] file ...

DESCRIPTION
SetFile is a tool to set the file attributes on files in an HFS+ directory. It attempts to be similar to the setfile command in MPW. It can apply rules to more than one file with the options applying to all files listed.

Flags:

-a attributes
    Sets the file attributes bits where 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). Note: attributes not specified remain unchanged.

    A | a
        Alias file

    B | b
        Has bundle

    C | c
        Custom icon (allowed on folders)

    D | d
        Located on the desktop (allowed on folders)

    I | i
        Inited - Finder is aware of this file and has given it a location in a window. (allowed on folders)

    L | l
        Locked

    M | m
        Shared (can run multiple times)

    N | n
        File has no INIT resource

    S | s
        System file (name locked)

    T | t
        Stationary file

    V | v
        Invisible (allowed on folders)

-c creator
    Specifies the file's creator, where creator is a sting of exactly four characters.

-d date
    Sets the creation date, where date is a string of the form: "mm/dd/[yy]yy [hh:mm:[:ss] [AM | PM]]" 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.

-m date
    Sets the modification date where date is a string of the form in -d above. (mm/dd/[yy]yy [hh:mm:[:ss] [AM | PM]])

-t type
    Sets the file type, where type is a string of exactly four characters.

RETURN VALUES
0   attributes set
1   syntax error
2   any other error

EXAMPLES
The following command line sets the creator and type for the ResEqual tool:

SetFile ResEqual -c "MPS " -t MPST

This command line sets the modification date of "myFile":

SetFile myFile -m "8/4/2001 16:13"