GetFileInfo

Get the file attributes on files in an HFS+ directory..

Syntax
      GetFileInfo [-a attributes] [-c creator] [-d date]
                     [-m date] [-t type] file ...

Options

     -a attributes
        Get 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
        attribute bit is set (1), a lowercase letter indicates
        that it is not (0).   

        A | a    Alias file

        B | b    Has bundle

        C | c    Custom icon (allowed on folders)

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

        E | e    Extension is hidden (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    "Stationery Pad" file

        V | v    Invisible (allowed on folders)

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

     -d date      Gets 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 21th century, e.g.20yy.

     -m date      Gets 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      Gets the file type, where type is a string of exactly four
        characters.

GetFileInfo is part of /Developer/Tools/

Return Values

0 - attributes read
1 - syntax error
2 - any other error

Examples

Get and print the creator for the "Late Breaking News" file:

GetFileInfo -c "Late Breaking News"

Print the modification date of "myFile":

GetFileInfo -m myFile

“The more the merrier” ~ John Heywood

Related macOS commands

chflags - Change a file or folder’s flags.
setfile
- Set attributes of HFS+ files.
textutil - Manipulate text files in various formats.


 
Copyright © 1999-2024 SS64.com
Some rights reserved