Skip navigation.
 
mlRe: ftp file busy?
FROM : Chris Suter
DATE : Tue Aug 08 07:54:46 2006

There should be a way of finding out what files are open since lsof 
does it. I would have thought lsof is open source so you could see 
what it does.

This problem doesn't sound Cocoa specific to me.

- Chris

On 08/08/2006, at 3:40 PM, Aaron Jacobs wrote:

> The FTP protocol itself may not have such a concept, but it is 
> possible that the FTP daemon which is writing to the files may flag 
> them as such, no?  Or the operating system, which realizes that 
> they are open for writing by the FTP daemon process?
>
> A huge kludge would be to check the file size once and then again a 
> few seconds later, if that is feasible for your application, and 
> see if it has changed.  But if you know in advance that they are 
> going to be JPEGs, you may as well just parse them.  That will have 
> the added advantage of weeding out (some kinds of) corrupt files.
>
>

>>> I have an application in which it monitors a particular folder 
>>> for new files and processes them.  In one particular case, the 
>>> files are being sent to the folder via FTP - I'm checking to see 
>>> if the files are busy (NSFileBusy) before trying to read them, 
>>> but in the case of FTP, it says they aren't busy.  Is there 
>>> another way to check for an incomplete file for the FTP case? 
>>> These are actually JPEG image files, so one option is to parse 
>>> the headers, get the image dimensions and compare to the file 
>>> size - but I was hoping there was an easier way to handle this. 
>>> Thanks.

>>
>> FTP doesn't have any concept of "file in use". Parse away.

> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Cocoa-dev mailing list      (<email_removed>)
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/<email_removed>-
> systems.com
>
> This email sent to <email_removed>
>


--
Coriolis Systems Limited is a limited company incorporated in England 
and Wales
Company No. 5061807  Registered Office: 10 Oxford Street, 
Southampton, SO14 3DJ

Related mailsAuthorDate
mlftp file busy? Jeff Schindler Aug 8, 05:32
mlRe: ftp file busy? Andrew Farmer Aug 8, 07:34
mlRe: ftp file busy? Aaron Jacobs Aug 8, 07:40
mlRe: ftp file busy? Chris Suter Aug 8, 07:54