On 8/31/2006 10:35 AM, David Glass wrote: > > On Aug 31, 2006, at 05:44, Charles Calvert wrote: > >> On 8/31/2006 1:20 AM, David Glass wrote: >>> >>> tisFileContents = filUpdateFile.ReadAll >>> >>> gives me a valid stream. No matter how many items are in the directory, >>> the last one always nils out. >> >> Have you tried checking filUpdateFile.Length before opening it? > > No, I haven't. I can though. What will having this information do for > me? I can watch the destination folder during the FTP process and see > the files show up and see that they have non-zero sizes.
If the file size is not correct, then there are some options: 1. The FTP may not have completed (though your description below makes this less likely). 2. The FTP may be completed, but the output stream may not have been closed, leaving some of the data in an I/O buffer (which could be the FTP control's buffer, the OS's buffer or a hardware buffer). >>> I suppose it is possible that the last file isn't completely present, >> >> Are you in control of the FTP process? If so, why not use interthread >> or interprocess communication to have the FTP process notify the file >> processing code when the file is ready? >> > > I'm not sure what 'in control' means. My application handles the FTP > transfer (using FTPSuite) so I think the answer to that is 'Yes'. That's what I meant. I wasn't sure if you were using a plug-in or an external process (e.g. using a shell object to execute the console ftp app.). > However, the files are not processed as they are retrieved, rather, all > the files are retrieved, then when that is done, the files are processed. > > So my process is not: > > 1. Download a file > 2. Process a file > 3. Repeat steps 1 and 2 until done > > Rather it is > > 1. Download a file > 2. Repeat step 1 until all files downloaded > 3. Process a file > 4. Repeat step 3 until all files processed Ah, that helps me understand better, thank you. > Given that all the FTP activity has completed I don't think there would > be anything for the FTP process/thread to report. Agreed, unless the FTPSuite isn't closing the stream, as Joseph Nastasi suggested. > Is it possible that all FTP activity *hasn't* completed when the > application runs on WinXP, but *has* on OS X? I'm not familiar with FTPSuite, but I'd say yes, at least in theory. There could be implementation differences between the two versions. If the other suggestions you've gotten don't help, go download this tool: <http://www.sysinternals.com/Utilities/Filemon.html> Install it on your test WinXP system and filter on your filename pattern. Then run your app. Once you get to the point of the error, look at Filemon's log and see if you can spot any discrepancies (e.g. the file isn't closed after creation). It will at least let you know what process has the file open and what the sequence of events was. -- Charles Calvert Celtic Wolf, Inc. (703) 580-0210 [EMAIL PROTECTED] http://www.celticwolf.com/ _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives of this list here: <http://support.realsoftware.com/listarchives/lists.html>
