Re: Check if File exists

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Agreed. Aye, a sleep would be needed... and.. not sure how you do it in C#
yet, but in Delphi, maybe a Application.ProcessMessages; which basically
refreshes the screen for any changes...


"Jon Skeet [C# MVP]" <skeet@xxxxxxxxx> wrote in message
news:MPG.1e3e1d84d90b965698cd4f@xxxxxxxxxxxxxxxxxxxxxxx
> Craig Lister <MyFirstName@xxxxxxxxxxxxxxxx> wrote:
>> Is there no c# way of saying...
>>
>> while fileexists=false....
>> {
>> // Do nothing...
>> }
>
> Yes, there is. But how often do you check? Is your "do nothing" meant
> to be a sleep, or did you really mean to go back to the test
> immediately? If so, that's a tight loop which will absolutely *hammer*
> the CPU until the file is created - and if whatever's creating that
> file is CPU-bound, it could take a long time to arrive...
>
> --
> Jon Skeet - <skeet@xxxxxxxxx>
> http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
> If replying to the group, please do not mail me too


.



Relevant Pages

  • Re: get the actual size of a file
    ... saying for certain either way:) ... Jon Skeet - ... If replying to the group, please do not mail me too ... Prev by Date: ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Consortium Clown
    ... > So there's me replying to a different thread and saying that you're not a ... > normal troll and at the same time and you go and say that. ... Prev by Date: ...
    (uk.sport.football.clubs.southampton)
  • Re: Do you cook/create better food when youre hammered?
    ... (snipped for brevity) ... Sheesh... ... you are replying to a post I made two weeks ago. ... but I'm not saying you do.... ...
    (rec.food.cooking)
  • Re: Have they lost their way?
    ... > # I wasn't "accusing", I was simply saying what I see and unless I knew ... > # beforehand the person replying had cropped it I'd still see.....ahhh ...
    (uk.radio.amateur)
  • Re: dan-o says "post some different lies"...
    ... and as you are by not saying ... just as I said...you are going to keep replying just for the sake of replying as to not look like you abandoned the thread. ... I also fail to see how telling you that you are wrong is digging any kind of hole. ... I am abandoning this thread. ...
    (microsoft.public.windows.vista.general)