On 8/31/2006 1:20 AM, David Glass wrote:
> Using 6r3 Std on WinXP...
> 
> I have a listbox that I populate with filenames that I get by iterating
> through FolderItem.Count.  In .Cell I put .Name and in .CellTag I put
> the actual FolderItem of each file.
> 
> Then, as a way to provide progress feedback to the user, I read the
> contents of each file, count the lines and put that number in the last
> column of the listbox.  So, after populating the listbox any given row
> would look like something like this:
> 
> FileZZZZZZ.txt   |   15 entries
> 
> That all works wonderfully, *until* my routine hits the last file. 
> Then, and only then, does my TextInputStream receive a nil.  So on every
> file, except the last one in the directory, the following:
> 
> 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?

[snip]

> ----Extra Info-----
> I don't know if it matters, but the entire process involves a download
> from an FTP server, and goes like this:
> 
> 1. Generate a list of files to download based on previously retrieved
> files and previously sent files
> 2. Download all the necessary files to a specified folder
> 3. Process the files in the folder
> 
> 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?

[snip rest]
-- 
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>

Reply via email to