Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer

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/

share|improve this answer
    
Not what I was looking for, but very useful info for another issue I have. I gave you a +1 for that! –  Michael Goldshteyn Feb 16 '11 at 15:44
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.