Re: Can't use TComponent in thread object?



brett wrote:
How is it possible for one thread to read the size of a file while
another thread is still writing to it? This runs into sharing I/O
errors.

It might have to do with the sharing flags you specified when opening the file.

But as I said before, you shouldn't need to poll the size of the file. As you download the file, simply keep track of how many bytes you've downloaded. That will also be the size of the file, but you'll have that number without needing another thread and without doing any additional I/O.

--
Rob
.



Relevant Pages

  • Re: Cant use TComponent in thread object?
    ... This runs into sharing I/O ... the writing process set the right sharing flags, ... on at least some filesystems. ... Personally I would break this into two different Apps ...
    (alt.comp.lang.borland-delphi)
  • Re: Cant use TComponent in thread object?
    ... This runs into sharing I/O ... the writing process set the right sharing flags, ... on at least some filesystems. ... Maarten Wiltink ...
    (alt.comp.lang.borland-delphi)