Re: File test
Hi
thanks, this is what i have done i.e. do while, catch, open file...
I thought I was missing a better approach!
I also have an error counter and a sleep in the loop so as not to wait for
ever and a day!
Thanks
"Gman" <nah> wrote in message
news:uOQE55kPGHA.1088@xxxxxxxxxxxxxxxxxxxxxxx
If you have control over the application creating the file, have it create
it with a different filename while its writing and then, once complete,
rename it.
Otherwise you can trap the error and postpone your read/move.
HTH
Adrian wrote:
Hi,
Before I open a file to read it etc how can I test to ensure it not
currently in use by another process?
the scenario is that I'm watch for a file to be created once it is I read
its contents and depending what they are I move it! however I'm getting
error when I'm am reading the file before its is fully written ( the
writing is slow as its over a WAN!) so I want to loop until the file is
fully created/ written.
thanks
.
Relevant Pages
- Re: Problem with a script
... a loop there becomes impractical. ... You still have them as uniquely named array indexes... ... writing the code twice will only ... reading your entire code and parsing it in their head, ... (comp.lang.php) - Re: Problem with a script
... Okay, so variables have unique labels, that doesn't mean they still couldn't be handled in a loop. ... You still have them as uniquely named array indexes... ... I believe that for the new guy this code would be readable, and identifying problems should really not be any more difficult with this, plus I think that it actually might save some time to write the actual code from the beginnig, even though it's not at it's final stage, instead of first writing everything spread out, and then rewriting the same code again cleaned. ... If you expect a person to spend an hour reading your entire code and parsing it in their head, you wont get any help and have to solve the problem by yourself. ... (comp.lang.php) - Re: Scanner class and last line in a file
... I can't repro the problem - help me understand what I'm missing. ... the following test class: ... And input file with no trailing newline created by: ... Then the second part of the for loop checks ... (comp.lang.java) - Re: Problem with a script
... a loop there becomes impractical. ... You still have them as uniquely named array indexes... ... writing the code twice will only ... reading your entire code and parsing it in their head, ... (comp.lang.php) - Re: what does "serialization" mean?
... >> resource reasons). ... >> other forms of writing saying what you really mean to say is a writing ... If you consider all loop forms of all languages, ... exposed "iteration" API. ... (comp.programming) |
|