• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: unlinking
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: unlinking


  • Subject: Re: unlinking
  • From: "Gerriet M. Denkmann" <email@hidden>
  • Date: Wed, 15 Oct 2008 19:15:30 +0200


On 15 Oct 2008, at 16:34, Quinn wrote:

At 14:02 +0200 15/10/08, Gerriet M. Denkmann wrote:
When one does unlink(someFile) and this file is open in some other program, it will be moved to HFS+ Private Data/temp123456 (or something like this).

Is it possible to check for this (file is open in some other program) without using lsof -F and parsing the result?

Normally folks ask the exact opposite of this question. Have you looked at the discussion in QA1497? Is that helpful to you?


<http://developer.apple.com/qa/qa2006/qa1497.html>

Thanks for this link; it was indeed helpful.

The problem I am trying to solve is a program which messes with files; it loops over all files in a partition, copies all fragmented files to a new location (space permitting) then deletes the old file.

Using unlink creates problems: some app continues to write into the file (now called ...temp4567), which will be deleted (and changes lost) when the app closes this file.

Using FSDeleteObject instead would be a step forward: in this case one would delete the _new_ copy if one got a fBsyErr. But this would happen _after_ one has already copied the stuff. Looks a bit wasteful.

So: is there some (fast) way to check whether some process has a given file open for writing or updating?


Kind regards,

Gerriet.

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Filesystem-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >unlinking (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: unlinking (From: Quinn <email@hidden>)

  • Prev by Date: Re: unlinking
  • Next by Date: From Inode to Process
  • Previous by thread: Re: unlinking
  • Next by thread: From Inode to Process
  • Index(es):
    • Date
    • Thread