Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FTP file currently being writen?

Status
Not open for further replies.

rxsid

Programmer
Jul 9, 2002
57
0
0
US
Hi all,
I've got an FTP process in PHP that needs to transfer files from server 2 to server3. Data gets trasnfered to server 2 from server 1 (a mainframe).
So:
server 1 = mainframe
server 2 = "ftp" server
server 3 = destination server.

How can I know if my FTP job running on server 3, to get files from server 2 can tell if the file that is about to be transfered from 2 to 3 is not being currently transfered from 1 to 2? Is there a return code in FTP that I can check for that says, hey...this file is currently in use, or currently being written to?

Thanks!
 
oh yeah, sorry:

ftp server is a windows 2003 advanced server
destination server is curretnly windows 2000, but will be upgraded soon to 2003 a.s
 
It is part of the operating system and the FTP file server to allow access to files actually being written. PHP cannot help here.
A suggestion:
Make the file transfer to a generated file name and rename the file after transfer to its final name. That way there is no amibiguity possible.
 
Some FTP servers provide interfaces to its current activity, including what logged-in users are currently doing. Some don't.

I assume that you're using the FTP server built into IIS. There may be some IIS function call that PHP could use which will tell you about the status of a particular file. I recommend that you research the intrinsics of IIS.

Want the best answers? Ask the best questions!

TANSTAAFL!!
 
i forgot to mention that this FTP job will be transfering upwards of 20,000 files per day on average, and from approximately 50 different "source" directories off of "root" on three different servers, and, I'm not allowed name/rename the data files programatically (security & HIPAA rules (if anyone knows where I'm coming from here)).

i was really hoping to handle this within FTP (return codes, etc.), but it appears that that isn't possible. i'll keep looking for a solution....thanks for the info all.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top