3

I'm investigating a problem with a utility we've developed. We track a file or a directory and when a change has been made we upload the new version to a central repository. Our utility is similar to dropbox in that you can track changes, but its a lot more of a version tracker than a sync utility.

We can detect when a file has been changed. But we'd like to be able to detect whether the process that made the change is still 'using' it ... for lack of a better term.

The problem occurs when a user has a file open in some program and periodically hits Save. Or, worst yet, an auto-save feature saves the work-in-progress every couple minutes. We want to be able to detect this and only save as needed, such as when the user finally saves and closes a file. If a program with an auto-save is open all night long we end up with hundreds of useless versions of the same file.

  1. Is it possible to detect what process saved a file?
  2. Is it possible to detect if that process is still 'using' that file.

This was straightforward in Windows but is proving extremely complicated in Mac. Additionally, we're windows and ios developers and are not so expert on OS X, particularly when it gets linuxy.

atlasalive
  • 31
  • 1

0 Answers0