saprouzy Posted August 2, 2005 Share Posted August 2, 2005 Hey therei have an applciation that gets files from an ftp server on a timer basisbut sometimes it imports the file while it's beeing written. which causes problems, so i want to know if there's a way to know if the file is openfor writing or not at the time when i want to get it.thanks Link to comment Share on other sites More sharing options...
dman Posted August 6, 2005 Share Posted August 6, 2005 (edited) try opening for input with lock.Open "c:\test.txt" for input lock Read as #1and trap the error 70 that occurs if file is already open.if it opens without error, close it and do your transfer. Edited August 6, 2005 by dman Link to comment Share on other sites More sharing options...
saprouzy Posted August 6, 2005 Author Share Posted August 6, 2005 the file that i want to check is not local, it's the remote file on the ftp that i want to check. i am getting the file not sending iti thougth about checking the size of the file 2 times in a row separated by 2-3 seconds, if the size is still the same then the file is still being written, and i try again after 5 minutes for example. but my managers didn't like the idea saying that i would cause alot of checking and alot of resources used on the server. (but i don't think so ) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now