osx - Is there a way to indicate anything done on Mac OS X across processes in the same way as named mutex in Windows? -


this question has answer here:

hypothetically have created several applications on mac os x use 1 shared resource or service. in applications want check if service or resource created in same way named mutex being used on windows in order not create everywhere. what's best way in cocoa?

if wish control access shared resource common unix/os x may create & lock file - file can 0 bytes long.

the system-level way of doing use flock (manual pages section 2), c-level way use stdio flockfile (manual pages section 3), think framework-level ways have been deprecated might wrong (apple appears in process of changing how filesystem operations supported has deprecated before supplying replacements).

note: file locking not same finder-level locking - former gives mutex, latter preventing modification.


Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -