1.

Solve : Filesize checker?

Answer»

Quote from: Dias de verano on April 23, 2009, 12:45:49 AM

You might want to consider PUTTING in a time delay so you aren't thrashing the hard DRIVE...
It thrashes the hard drive???Quote from: Helpmeh on April 23, 2009, 02:25:54 PM
It thrashes the hard drive???

How did you think it GETS the file size?Quote from: Dias de verano on April 23, 2009, 03:41:28 PM
How did you think it gets the file size?
Exactly? I have no idea...if you would like, explain how it gets the filesize.Quote from: Helpmeh on April 23, 2009, 04:17:07 PM
Exactly? I have no idea...if you would like, explain how it gets the filesize.

By reading the hard drive, which is where the file is stored. THis means that whatever else the hard drive is doing at the time, it will have to stop, move the read /WRITE head to the correct part of the disk surface, wait for the sector containing the data to come ROUND, read the data, and then go back to whatever it was doing before. Your script is going round in a loop hitting the disk with requests. THis could slow down everything else. Therefore waiting at least a second or two before looping again is a good idea.
Quote from: Dias de verano on April 24, 2009, 12:15:24 AM
By reading the hard drive, which is where the file is stored. THis means that whatever else the hard drive is doing at the time, it will have to stop, move the read /write head to the correct part of the disk surface, wait for the sector containing the data to come round, read the data, and then go back to whatever it was doing before. Your script is going round in a loop hitting the disk with requests. THis could slow down everything else. Therefore waiting at least a second or two before looping again is a good idea.

So the second part would be:
Code: [Select]for %%a in ("C:\test\continue.txt") do set nfs=%%~za
ping localhost -n 1 -w 1000 > nul
if "%ofs%"=="%nfs%" goto loop2
goto loopSomething like that. You can adjust the period of the delay; only you know how long that should be: a second, a minute, an hour.



Discussion

No Comment Found