Re: ftp file busy?
Re: ftp file busy?
- Subject: Re: ftp file busy?
- From: Chris Suter <email@hidden>
- Date: Tue, 8 Aug 2006 15:54:46 +1000
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@hidden)
Help/Unsubscribe/Update your Subscription:
systems.com
This email sent to email@hidden
--
Coriolis Systems Limited is a limited company incorporated in England
and Wales
Company No. 5061807 Registered Office: 10 Oxford Street,
Southampton, SO14 3DJ
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden