NSSearchPathForDirectoriesInDomains

MacのFoundation Frameworkには、NSSearchPathForDirectoriesInDomainsなるOSで定義されたさまざまなファイルパスを取得する関数がある。

MacOSX上で、こいつが引数によってどんな結果を返すのか興味があったので調べてみた。

func NSSearchPathForDirectoriesInDomains(_ directory: NSSearchPathDirectory,
                                                                              _ domainMask: NSSearchPathDomainMask,
                                                                              _ expandTilde: Bool) -> [AnyObject]!

フォーマットはSWIFT形式で。オンラインヘルプはこちら

ヘルプには、これを使うよりも、NSFileManagerのURLsForDirectory:inDomains:やURLForDirectory:inDomain:appropriateForURL:create:error:を使えということなので、ついでにこいつらも調べる。

テストコードはこちら。ま、ぐるぐるまわして、関数叩いて、結果をprintln()。実験は、MacOS X 10.10.1.。iOSでやったら、違う結果になるんじゃないかな。

まず、NSSearchPathForDirectoriesInDomains()

user_nameは現在のユーザー名をあらわす。

expandTilde domainMask directory result
True UserDomainMask ApplicationDirectory [/Users/user_name/Applications]
DemoApplicationDirectory [/Users/user_name/Applications/Demos]
DeveloperApplicationDirectory [/Users/user_name/Developer/Applications]
AdminApplicationDirectory [/Users/user_name/Applications/Utilities]
LibraryDirectory [/Users/user_name/Library]
DeveloperDirectory [/Users/user_name/Developer]
UserDirectory []
DocumentationDirectory [/Users/user_name/Library/Documentation]
DocumentDirectory [/Users/user_name/Documents]
CoreServiceDirectory []
AutosavedInformationDirectory [/Users/user_name/Library/Autosave Information]
DesktopDirectory [/Users/user_name/Desktop]
CachesDirectory [/Users/user_name/Library/Caches]
ApplicationSupportDirectory [/Users/user_name/Library/Application Support]
DownloadsDirectory [/Users/user_name/Downloads]
InputMethodsDirectory [/Users/user_name/Library/Input Methods]
MoviesDirectory [/Users/user_name/Movies]
MusicDirectory [/Users/user_name/Music]
PicturesDirectory [/Users/user_name/Pictures]
PrinterDescriptionDirectory []
SharedPublicDirectory [/Users/user_name/Public]
PreferencePanesDirectory [/Users/user_name/Library/PreferencePanes]
ApplicationScriptsDirectory [/Users/user_name/Library/Application Scripts/com.cagylogic.SystemDirectoryTest]
ItemReplacementDirectory []
AllApplicationsDirectory [/Users/user_name/Applications
/Users/user_name/Applications/Utilities
/Users/user_name/Developer/Applications
/Users/user_name/Applications/Demos]
AllLibrariesDirectory [/Users/user_name/Library
/Users/user_name/Developer]
TrashDirectory [/Users/user_name/.Trash]
LocalDomainMask ApplicationDirectory [/Applications]
DemoApplicationDirectory [/Applications/Demos]
DeveloperApplicationDirectory [/Developer/Applications]
AdminApplicationDirectory [/Applications/Utilities]
LibraryDirectory [/Library]
DeveloperDirectory [/Developer]
UserDirectory [/Users]
DocumentationDirectory [/Library/Documentation]
DocumentDirectory []
CoreServiceDirectory []
AutosavedInformationDirectory []
DesktopDirectory []
CachesDirectory [/Library/Caches]
ApplicationSupportDirectory [/Library/Application Support]
DownloadsDirectory []
InputMethodsDirectory [/Library/Input Methods]
MoviesDirectory []
MusicDirectory []
PicturesDirectory []
PrinterDescriptionDirectory []
SharedPublicDirectory []
PreferencePanesDirectory [/Library/PreferencePanes]
ApplicationScriptsDirectory []
ItemReplacementDirectory []
AllApplicationsDirectory [/Applications
/Applications/Utilities
/Developer/Applications
/Applications/Demos]
AllLibrariesDirectory [/Library
/Developer]
TrashDirectory [/Users/user_name/.Trash]
NetworkDomainMask ApplicationDirectory [/Network/Applications]
DemoApplicationDirectory [/Network/Applications/Demos]
DeveloperApplicationDirectory [/Network/Developer/Applications]
AdminApplicationDirectory [/Network/Applications/Utilities]
LibraryDirectory [/Network/Library]
DeveloperDirectory [/Network/Developer]
UserDirectory [/Network/Users]
DocumentationDirectory [/Network/Library/Documentation]
DocumentDirectory []
CoreServiceDirectory []
AutosavedInformationDirectory []
DesktopDirectory []
CachesDirectory []
ApplicationSupportDirectory [/Network/Library/Application Support]
DownloadsDirectory []
InputMethodsDirectory [/Network/Library/Input Methods]
MoviesDirectory []
MusicDirectory []
PicturesDirectory []
PrinterDescriptionDirectory []
SharedPublicDirectory []
PreferencePanesDirectory []
ApplicationScriptsDirectory []
ItemReplacementDirectory []
AllApplicationsDirectory [/Network/Applications
/Network/Applications/Utilities
/Network/Developer/Applications
/Network/Applications/Demos]
AllLibrariesDirectory [/Network/Library
/Network/Developer]
TrashDirectory []
SystemDomainMask ApplicationDirectory [/Applications]
DemoApplicationDirectory [/Applications/Demos]
DeveloperApplicationDirectory [/Developer/Applications]
AdminApplicationDirectory [/Applications/Utilities]
LibraryDirectory [/System/Library]
DeveloperDirectory [/Developer]
UserDirectory []
DocumentationDirectory [/System/Library/Documentation]
DocumentDirectory []
CoreServiceDirectory [/System/Library/CoreServices]
AutosavedInformationDirectory []
DesktopDirectory []
CachesDirectory [/System/Library/Caches]
ApplicationSupportDirectory [/Library/Application Support]
DownloadsDirectory []
InputMethodsDirectory [/System/Library/Input Methods]
MoviesDirectory []
MusicDirectory []
PicturesDirectory []
PrinterDescriptionDirectory [/System/Library/Printers/PPDs]
SharedPublicDirectory []
PreferencePanesDirectory [/System/Library/PreferencePanes]
ApplicationScriptsDirectory []
ItemReplacementDirectory []
AllApplicationsDirectory [/Applications
/Applications/Utilities
/Developer/Applications
/Applications/Demos]
AllLibrariesDirectory [/System/Library
/Developer]
TrashDirectory []
AllDomainsMask ApplicationDirectory [/Users/user_name/Applications
/Applications
/Network/Applications]
DemoApplicationDirectory [/Users/user_name/Applications/Demos
/Applications/Demos
/Network/Applications/Demos]
DeveloperApplicationDirectory [/Users/user_name/Developer/Applications
/Developer/Applications
/Network/Developer/Applications]
AdminApplicationDirectory [/Users/user_name/Applications/Utilities
/Applications/Utilities
/Network/Applications/Utilities]
LibraryDirectory [/Users/user_name/Library
/Library
/Network/Library
/System/Library]
DeveloperDirectory [/Users/user_name/Developer
/Developer
/Network/Developer]
UserDirectory [/Users
/Network/Users]
DocumentationDirectory [/Users/user_name/Library/Documentation
/Library/Documentation
/Network/Library/Documentation
/System/Library/Documentation]
DocumentDirectory [/Users/user_name/Documents]
CoreServiceDirectory [/System/Library/CoreServices]
AutosavedInformationDirectory [/Users/user_name/Library/Autosave Information]
DesktopDirectory [/Users/user_name/Desktop]
CachesDirectory [/Users/user_name/Library/Caches
/Library/Caches
/System/Library/Caches]
ApplicationSupportDirectory [/Users/user_name/Library/Application Support
/Library/Application Support
/Network/Library/Application Support]
DownloadsDirectory [/Users/user_name/Downloads]
InputMethodsDirectory [/Users/user_name/Library/Input Methods
/Library/Input Methods
/Network/Library/Input Methods
/System/Library/Input Methods]
MoviesDirectory [/Users/user_name/Movies]
MusicDirectory [/Users/user_name/Music]
PicturesDirectory [/Users/user_name/Pictures]
PrinterDescriptionDirectory [/System/Library/Printers/PPDs]
SharedPublicDirectory [/Users/user_name/Public]
PreferencePanesDirectory [/Users/user_name/Library/PreferencePanes
/Library/PreferencePanes
/System/Library/PreferencePanes]
ApplicationScriptsDirectory [/Users/user_name/Library/Application Scripts/com.cagylogic.SystemDirectoryTest]
ItemReplacementDirectory []
AllApplicationsDirectory [/Users/user_name/Applications
/Users/user_name/Applications/Utilities
/Users/user_name/Developer/Applications
/Users/user_name/Applications/Demos
/Applications
/Applications/Utilities
/Developer/Applications
/Applications/Demos
/Network/Applications
/Network/Applications/Utilities
/Network/Developer/Applications
/Network/Applications/Demos]
AllLibrariesDirectory [/Users/user_name/Library
/Users/user_name/Developer
/Library
/Developer
/Network/Library
/Network/Developer
/System/Library
/Developer]
TrashDirectory [/Users/user_name/.Trash
/Users/user_name/.Trash]
False UserDomainMask ApplicationDirectory [~/Applications]
DemoApplicationDirectory [~/Applications/Demos]
DeveloperApplicationDirectory [~/Developer/Applications]
AdminApplicationDirectory [~/Applications/Utilities]
LibraryDirectory [~/Library]
DeveloperDirectory [~/Developer]
UserDirectory []
DocumentationDirectory [~/Library/Documentation]
DocumentDirectory [~/Documents]
CoreServiceDirectory []
AutosavedInformationDirectory [~/Library/Autosave Information]
DesktopDirectory [~/Desktop]
CachesDirectory [~/Library/Caches]
ApplicationSupportDirectory [~/Library/Application Support]
DownloadsDirectory [~/Downloads]
InputMethodsDirectory [~/Library/Input Methods]
MoviesDirectory [~/Movies]
MusicDirectory [~/Music]
PicturesDirectory [~/Pictures]
PrinterDescriptionDirectory []
SharedPublicDirectory [~/Public]
PreferencePanesDirectory [~/Library/PreferencePanes]
ApplicationScriptsDirectory [/Users/user_name/Library/Application Scripts/com.cagylogic.SystemDirectoryTest]
ItemReplacementDirectory []
AllApplicationsDirectory [~/Applications
~/Applications/Utilities
~/Developer/Applications
~/Applications/Demos]
AllLibrariesDirectory [~/Library
~/Developer]
TrashDirectory [~/.Trash]
LocalDomainMask ApplicationDirectory [/Applications]
DemoApplicationDirectory [/Applications/Demos]
DeveloperApplicationDirectory [/Developer/Applications]
AdminApplicationDirectory [/Applications/Utilities]
LibraryDirectory [/Library]
DeveloperDirectory [/Developer]
UserDirectory [/Users]
DocumentationDirectory [/Library/Documentation]
DocumentDirectory []
CoreServiceDirectory []
AutosavedInformationDirectory []
DesktopDirectory []
CachesDirectory [/Library/Caches]
ApplicationSupportDirectory [/Library/Application Support]
DownloadsDirectory []
InputMethodsDirectory [/Library/Input Methods]
MoviesDirectory []
MusicDirectory []
PicturesDirectory []
PrinterDescriptionDirectory []
SharedPublicDirectory []
PreferencePanesDirectory [/Library/PreferencePanes]
ApplicationScriptsDirectory []
ItemReplacementDirectory []
AllApplicationsDirectory [/Applications
/Applications/Utilities
/Developer/Applications
/Applications/Demos]
AllLibrariesDirectory [/Library
/Developer]
TrashDirectory [/Users/user_name/.Trash]
NetworkDomainMask ApplicationDirectory [/Network/Applications]
DemoApplicationDirectory [/Network/Applications/Demos]
DeveloperApplicationDirectory [/Network/Developer/Applications]
AdminApplicationDirectory [/Network/Applications/Utilities]
LibraryDirectory [/Network/Library]
DeveloperDirectory [/Network/Developer]
UserDirectory [/Network/Users]
DocumentationDirectory [/Network/Library/Documentation]
DocumentDirectory []
CoreServiceDirectory []
AutosavedInformationDirectory []
DesktopDirectory []
CachesDirectory []
ApplicationSupportDirectory [/Network/Library/Application Support]
DownloadsDirectory []
InputMethodsDirectory [/Network/Library/Input Methods]
MoviesDirectory []
MusicDirectory []
PicturesDirectory []
PrinterDescriptionDirectory []
SharedPublicDirectory []
PreferencePanesDirectory []
ApplicationScriptsDirectory []
ItemReplacementDirectory []
AllApplicationsDirectory [/Network/Applications
/Network/Applications/Utilities
/Network/Developer/Applications
/Network/Applications/Demos]
AllLibrariesDirectory [/Network/Library
/Network/Developer]
TrashDirectory []
SystemDomainMask ApplicationDirectory [/Applications]
DemoApplicationDirectory [/Applications/Demos]
DeveloperApplicationDirectory [/Developer/Applications]
AdminApplicationDirectory [/Applications/Utilities]
LibraryDirectory [/System/Library]
DeveloperDirectory [/Developer]
UserDirectory []
DocumentationDirectory [/System/Library/Documentation]
DocumentDirectory []
CoreServiceDirectory [/System/Library/CoreServices]
AutosavedInformationDirectory []
DesktopDirectory []
CachesDirectory [/System/Library/Caches]
ApplicationSupportDirectory [/Library/Application Support]
DownloadsDirectory []
InputMethodsDirectory [/System/Library/Input Methods]
MoviesDirectory []
MusicDirectory []
PicturesDirectory []
PrinterDescriptionDirectory [/System/Library/Printers/PPDs]
SharedPublicDirectory []
PreferencePanesDirectory [/System/Library/PreferencePanes]
ApplicationScriptsDirectory []
ItemReplacementDirectory []
AllApplicationsDirectory [/Applications
/Applications/Utilities
/Developer/Applications
/Applications/Demos]
AllLibrariesDirectory [/System/Library
/Developer]
TrashDirectory []
AllDomainsMask ApplicationDirectory [~/Applications
/Applications
/Network/Applications]
DemoApplicationDirectory [~/Applications/Demos
/Applications/Demos
/Network/Applications/Demos]
DeveloperApplicationDirectory [~/Developer/Applications
/Developer/Applications
/Network/Developer/Applications]
AdminApplicationDirectory [~/Applications/Utilities
/Applications/Utilities
/Network/Applications/Utilities]
LibraryDirectory [~/Library
/Library
/Network/Library
/System/Library]
DeveloperDirectory [~/Developer
/Developer
/Network/Developer]
UserDirectory [/Users
/Network/Users]
DocumentationDirectory [~/Library/Documentation
/Library/Documentation
/Network/Library/Documentation
/System/Library/Documentation]
DocumentDirectory [~/Documents]
CoreServiceDirectory [/System/Library/CoreServices]
AutosavedInformationDirectory [~/Library/Autosave Information]
DesktopDirectory [~/Desktop]
CachesDirectory [~/Library/Caches
/Library/Caches
/System/Library/Caches]
ApplicationSupportDirectory [~/Library/Application Support
/Library/Application Support
/Network/Library/Application Support]
DownloadsDirectory [~/Downloads]
InputMethodsDirectory [~/Library/Input Methods
/Library/Input Methods
/Network/Library/Input Methods
/System/Library/Input Methods]
MoviesDirectory [~/Movies]
MusicDirectory [~/Music]
PicturesDirectory [~/Pictures]
PrinterDescriptionDirectory [/System/Library/Printers/PPDs]
SharedPublicDirectory [~/Public]
PreferencePanesDirectory [~/Library/PreferencePanes
/Library/PreferencePanes
/System/Library/PreferencePanes]
ApplicationScriptsDirectory [/Users/user_name/Library/Application Scripts/com.cagylogic.SystemDirectoryTest]
ItemReplacementDirectory []
AllApplicationsDirectory [~/Applications
~/Applications/Utilities
~/Developer/Applications
~/Applications/Demos
/Applications
/Applications/Utilities
/Developer/Applications
/Applications/Demos
/Network/Applications
/Network/Applications/Utilities
/Network/Developer/Applications
/Network/Applications/Demos]
AllLibrariesDirectory [~/Library
~/Developer
/Library
/Developer
/Network/Library
/Network/Developer
/System/Library
/Developer]
TrashDirectory [~/.Trash
/Users/user_name/.Trash]

次にNSFileManagerのURLsForDirectory:inDomains:

user_nameは現在のユーザー名をあらわす。

domainMask directory result
UserDomainMask ApplicationDirectory [file:///Users/user_name/Applications/]
DemoApplicationDirectory [file:///Users/user_name/Applications/Demos/]
DeveloperApplicationDirectory [file:///Users/user_name/Developer/Applications/]
AdminApplicationDirectory [file:///Users/user_name/Applications/Utilities/]
LibraryDirectory [file:///Users/user_name/Library/]
DeveloperDirectory [file:///Users/user_name/Developer/]
UserDirectory []
DocumentationDirectory [file:///Users/user_name/Library/Documentation/]
DocumentDirectory [file:///Users/user_name/Documents/]
CoreServiceDirectory []
AutosavedInformationDirectory [file:///Users/user_name/Library/Autosave%20Information/]
DesktopDirectory [file:///Users/user_name/Desktop/]
CachesDirectory [file:///Users/user_name/Library/Caches/]
ApplicationSupportDirectory [file:///Users/user_name/Library/Application%20Support/]
DownloadsDirectory [file:///Users/user_name/Downloads/]
InputMethodsDirectory [file:///Users/user_name/Library/Input%20Methods/]
MoviesDirectory [file:///Users/user_name/Movies/]
MusicDirectory [file:///Users/user_name/Music/]
PicturesDirectory [file:///Users/user_name/Pictures/]
PrinterDescriptionDirectory []
SharedPublicDirectory [file:///Users/user_name/Public/]
PreferencePanesDirectory [file:///Users/user_name/Library/PreferencePanes/]
ApplicationScriptsDirectory [file:///Users/user_name/Library/Application%20Scripts/com.cagylogic.SystemDirectoryTest/]
ItemReplacementDirectory []
AllApplicationsDirectory [file:///Users/user_name/Applications/
file:///Users/user_name/Applications/Utilities/
file:///Users/user_name/Developer/Applications/
file:///Users/user_name/Applications/Demos/]
AllLibrariesDirectory [file:///Users/user_name/Library/
file:///Users/user_name/Developer/]
TrashDirectory [file:///Users/user_name/.Trash/]
LocalDomainMask ApplicationDirectory [file:///Applications/]
DemoApplicationDirectory [file:///Applications/Demos/]
DeveloperApplicationDirectory [file:///Developer/Applications/]
AdminApplicationDirectory [file:///Applications/Utilities/]
LibraryDirectory [file:///Library/]
DeveloperDirectory [file:///Developer/]
UserDirectory [file:///Users/]
DocumentationDirectory [file:///Library/Documentation/]
DocumentDirectory []
CoreServiceDirectory []
AutosavedInformationDirectory []
DesktopDirectory []
CachesDirectory [file:///Library/Caches/]
ApplicationSupportDirectory [file:///Library/Application%20Support/]
DownloadsDirectory []
InputMethodsDirectory [file:///Library/Input%20Methods/]
MoviesDirectory []
MusicDirectory []
PicturesDirectory []
PrinterDescriptionDirectory []
SharedPublicDirectory []
PreferencePanesDirectory [file:///Library/PreferencePanes/]
ApplicationScriptsDirectory []
ItemReplacementDirectory []
AllApplicationsDirectory [file:///Applications/
file:///Applications/Utilities/
file:///Developer/Applications/
file:///Applications/Demos/]
AllLibrariesDirectory [file:///Library/
file:///Developer/]
TrashDirectory [file:///Users/user_name/.Trash/]
NetworkDomainMask ApplicationDirectory [file:///Network/Applications/]
DemoApplicationDirectory [file:///Network/Applications/Demos/]
DeveloperApplicationDirectory [file:///Network/Developer/Applications/]
AdminApplicationDirectory [file:///Network/Applications/Utilities/]
LibraryDirectory [file:///Network/Library/]
DeveloperDirectory [file:///Network/Developer/]
UserDirectory [file:///Network/Users/]
DocumentationDirectory [file:///Network/Library/Documentation/]
DocumentDirectory []
CoreServiceDirectory []
AutosavedInformationDirectory []
DesktopDirectory []
CachesDirectory []
ApplicationSupportDirectory [file:///Network/Library/Application%20Support/]
DownloadsDirectory []
InputMethodsDirectory [file:///Network/Library/Input%20Methods/]
MoviesDirectory []
MusicDirectory []
PicturesDirectory []
PrinterDescriptionDirectory []
SharedPublicDirectory []
PreferencePanesDirectory []
ApplicationScriptsDirectory []
ItemReplacementDirectory []
AllApplicationsDirectory [file:///Network/Applications/
file:///Network/Applications/Utilities/
file:///Network/Developer/Applications/
file:///Network/Applications/Demos/]
AllLibrariesDirectory [file:///Network/Library/
file:///Network/Developer/]
TrashDirectory []
SystemDomainMask ApplicationDirectory [file:///Applications/]
DemoApplicationDirectory [file:///Applications/Demos/]
DeveloperApplicationDirectory [file:///Developer/Applications/]
AdminApplicationDirectory [file:///Applications/Utilities/]
LibraryDirectory [file:///System/Library/]
DeveloperDirectory [file:///Developer/]
UserDirectory []
DocumentationDirectory [file:///System/Library/Documentation/]
DocumentDirectory []
CoreServiceDirectory [file:///System/Library/CoreServices/]
AutosavedInformationDirectory []
DesktopDirectory []
CachesDirectory [file:///System/Library/Caches/]
ApplicationSupportDirectory [file:///Library/Application%20Support/]
DownloadsDirectory []
InputMethodsDirectory [file:///System/Library/Input%20Methods/]
MoviesDirectory []
MusicDirectory []
PicturesDirectory []
PrinterDescriptionDirectory [file:///System/Library/Printers/PPDs/]
SharedPublicDirectory []
PreferencePanesDirectory [file:///System/Library/PreferencePanes/]
ApplicationScriptsDirectory []
ItemReplacementDirectory []
AllApplicationsDirectory [file:///Applications/
file:///Applications/Utilities/
file:///Developer/Applications/
file:///Applications/Demos/]
AllLibrariesDirectory [file:///System/Library/
file:///Developer/]
TrashDirectory []
AllDomainsMask ApplicationDirectory [file:///Users/user_name/Applications/
file:///Applications/
file:///Network/Applications/]
DemoApplicationDirectory [file:///Users/user_name/Applications/Demos/
file:///Applications/Demos/
file:///Network/Applications/Demos/]
DeveloperApplicationDirectory [file:///Users/user_name/Developer/Applications/
file:///Developer/Applications/
file:///Network/Developer/Applications/]
AdminApplicationDirectory [file:///Users/user_name/Applications/Utilities/
file:///Applications/Utilities/
file:///Network/Applications/Utilities/]
LibraryDirectory [file:///Users/user_name/Library/
file:///Library/
file:///Network/Library/
file:///System/Library/]
DeveloperDirectory [file:///Users/user_name/Developer/
file:///Developer/
file:///Network/Developer/]
UserDirectory [file:///Users/
file:///Network/Users/]
DocumentationDirectory [file:///Users/user_name/Library/Documentation/
file:///Library/Documentation/
file:///Network/Library/Documentation/
file:///System/Library/Documentation/]
DocumentDirectory [file:///Users/user_name/Documents/]
CoreServiceDirectory [file:///System/Library/CoreServices/]
AutosavedInformationDirectory [file:///Users/user_name/Library/Autosave%20Information/]
DesktopDirectory [file:///Users/user_name/Desktop/]
CachesDirectory [file:///Users/user_name/Library/Caches/
file:///Library/Caches/
file:///System/Library/Caches/]
ApplicationSupportDirectory [file:///Users/user_name/Library/Application%20Support/
file:///Library/Application%20Support/
file:///Network/Library/Application%20Support/]
DownloadsDirectory [file:///Users/user_name/Downloads/]
InputMethodsDirectory [file:///Users/user_name/Library/Input%20Methods/
file:///Library/Input%20Methods/
file:///Network/Library/Input%20Methods/
file:///System/Library/Input%20Methods/]
MoviesDirectory [file:///Users/user_name/Movies/]
MusicDirectory [file:///Users/user_name/Music/]
PicturesDirectory [file:///Users/user_name/Pictures/]
PrinterDescriptionDirectory [file:///System/Library/Printers/PPDs/]
SharedPublicDirectory [file:///Users/user_name/Public/]
PreferencePanesDirectory [file:///Users/user_name/Library/PreferencePanes/
file:///Library/PreferencePanes/
file:///System/Library/PreferencePanes/]
ApplicationScriptsDirectory [file:///Users/user_name/Library/Application%20Scripts/com.cagylogic.SystemDirectoryTest/]
ItemReplacementDirectory []
AllApplicationsDirectory [file:///Users/user_name/Applications/
file:///Users/user_name/Applications/Utilities/
file:///Users/user_name/Developer/Applications/
file:///Users/user_name/Applications/Demos/
file:///Applications/
file:///Applications/Utilities/
file:///Developer/Applications/
file:///Applications/Demos/
file:///Network/Applications/
file:///Network/Applications/Utilities/
file:///Network/Developer/Applications/
file:///Network/Applications/Demos/]
AllLibrariesDirectory [file:///Users/user_name/Library/
file:///Users/user_name/Developer/
file:///Library/
file:///Developer/
file:///Network/Library/
file:///Network/Developer/
file:///System/Library/
file:///Developer/]
TrashDirectory [file:///Users/user_name/.Trash/
file:///Users/user_name/.Trash/]

上記以外に、NSTemporaryDirectory()と、NSHomeDirectory()という関数がある。

NSTemporaryDirectory()のヘルプの項目では、NSTemporaryDirectory()を使わずに、NSFileManager.URLForDirectory()を検討せよとの記述があるけど、Directoryにはtemporaryってのはないので、みんなどうしてるのかしら。cacheでもつかってるのかしら。

ちなみに、NSTemporaryDirectory()で返ってきたのは、

/var/folders/gr/cw19w9ls39sdbbch5rc75nn40000gn/T/

みたいな値。うーん、なかなか奥が深い。

コメントを残す