im trying to wait for a download on a file in my program
but winnt wont lockup the file when its being downloaded!
Who is Participating?
AlexVirochovskyConnect With a Mentor Commented:
I see for you 2 possibilities:
1. Use FindFirstChangeNotification: see
2. Use utility
  for  File Monitoring(Open/Close/Change Dir ,,,,

Can be this helps, Alex
haag ??
how do you 'download' the file ? and esspecially how do you save it to disk ???
webrageAuthor Commented:
the file is being downloaded to a directory by ftp. My program triggers when a new file apear in the ftp directory! Then I want to wait for the file to be fully downloaded before i do something about it. But i cant see any diffrent(between a normal file and to the file being downloaded) in flags set to the file.
running nt with ntfs!
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

it seems that this is a question of FTP client. what's your client ? isn't there some other way to work in conjunction with this program.

(Note: maybe you can monitor File I/O activity and wait for the FileClose to be called ??)

webrageAuthor Commented:
hmm.. i dont think its a client dependent problem...
maybe ftp server problem...
but this is thought to be a generall program so it would
be better solve this with code...

       it seems that I still can't get the Question
        ok - so you have remote server computer running FTP server
        and local client computer (workstation)

            some program (FTP client) downloads files in 'FTP directory'
            your program triggers when a new file apear in that directory.
            than you want to do something with the file, after it has been fully downloaded.

      1. the FTP client is the one that (eventually) manages the file locking ...
      2. how is your porogram triggered ?
      3. I proposed to wait till the ftp client executes FileClose from WinAPI ...


You can try monitoring len of file and if it is constant
in DELAY sec, can conclusive, that download is ended.
webrageAuthor Commented:
hmm sorry Alex I have also thought about that, but it is to uncertain..
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.