0

I work in a command prompt quite often and around many large (remote) log files. Unfortunatelly, the sizes of these files do not update as the logs grow, unless it would appear the files are touched. I usually use hacks like the following from Cygwin to "touch" the file so that its file size updates:

stat file.txt

or

head -c0 file.txt

Are there any native Windows constructs that can refresh the file size from the command prompt, as unintrusively as possible and preferrably without transferring any (remote) data, since I often need to refresh the sizes of very large files remotely, to see how large they have grown.

Update: Doing a dir on the file itself seems to update its size:

dir file.txt

The question now is: How do you update all file sizes in a directory, so that they are current? That is:

Enter mystery command, then:

dir should display correct current file sizes.

1 Answer 1

1

i'm not too sure if this will be of help, but after googling for some time, i found this thread in programmersheaven.com . hope this helps.

http://www.programmersheaven.com/mb/MS-DOS/382631/382631/dos-commandbatch-file-to-find-a-folder-size/

1
  • Not what I was looking for, but very useful info for another issue I have. I gave you a +1 for that! Feb 16, 2011 at 15:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .