LoginSignup
0
1

More than 5 years have passed since last update.

SetFile

Posted at

名前

/usr/bin/SetFile -- ファイルやフォルダの属性を設定する (DEPRECATED)

書式

/usr/bin/SetFile [-P] [-a attributes] [-c creator] [-d date] [-m date] [-t type] file ...

概要

Xcode 6で非推奨1となった/usr/bin/SetFileを含むCarbon開発をサポートするツール2

/usr/bin/SetFileはHFS+上のファイルやディレクトリのファイル属性を設定するツール。

説明

-P

シンボリックリンクを解決したファイルではなく、シンボリックファイル自身に作用する。

-a attributes

属性が大文字小文字を区別する文字であるファイルの属性ビットを設定する。各々の文字はファイルの属性に対応する。大文字は属性ビットを(1)に設定、小文字は属性ビットを(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)
Z | z    Busy (allowed on folders)

-c creater

ファイルクリエータを指定する。createrは4つのMacRoman文字列、nullクリエータを指定する空文字、または標準的な表記の2進数、10進数、8進数、16進数。

-d date

作成日を指定する。dateは"mm/dd/[yy]yy [hh:flag_mm:[:ss] [AM | PM]]"形式の文字列。

-m date

修正日を指定する。date-d形式の文字列。

-t type

ファイルタイプを指定する。typeは4つのMacRoman文字列、nullクリエータを指定する空文字、または標準的な表記の2進数、10進数、8進数、16進数。

戻り値

0        属性は設定
1        構文エラー
2        その他のエラー

このコマンドラインは"myFile"の修正日を設定する。

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

このコマンドラインは"myFolder"シンボリックリンクを不可視に設定する。

$ SetFile -P -a V myFolder

  1. OS X El Capitanでも動作する。 

  2. XcodeのCommand Line Toolsに含まれる。 

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1