hfs+

Is an atomic-rename possible in Mac VFS/HFS+?

限于喜欢 提交于 2020-01-11 13:25:14
问题 With support for ACLs in Mac OS X, there is a way to declare a file as writeable but non-deletable. This poses a problem with atomic writes, since the current implementation of rename in VFS delete s a pre-existing target. If you have an existing file, which you have write privileges on, it is possible to be unable to atomically write to: Simply attach an ACL that states deny delete and an atomic write (like implemented by various Cocoa APIs — e.g. NSArray's writeToFile:atomically:) will fail

How can I receive notifications of filesystem changes in OS X?

眉间皱痕 提交于 2019-12-05 07:21:35
问题 In Windows, I can use the FindNextChangeNotification API to watch a file or folder for changes. For example, I can watch a folder and get notified when a file is added or removed. Is there a similar API on OS X? 回答1: Mac OS X v10.5 introduces the File System Events API. Have a look at: Technology Overview Using the File System Events API File System Events Programming Guide (PDF) 回答2: FSEvents is nice, but for watching just a small set of files or folders it's rather overkill, and it does