Archive: Deleting files with 0 bytes


Deleting files with 0 bytes
There a way to delete files that have nothing in them? thank you


use delete on file whose size is provided by ... maybe a plugin ? I don't know, I use FileSeek "file" 0 END $0 and check for $0 value (The end position in the file).

Gal'


thanks galevsky.

may someone give me an example of that, please?



FileOpen $0 "$TEMP\foo.txt" "w"
;FileWrite $0 "abc"
FileSeek $0 0 END $1
FileClose $0
${If} $1 > 0
MessageBox MB_OK "File has more than 0 char"
${Else}
MessageBox MB_OK "File is empty"
${EndIf}


Uncomment the second line and $1 is 3.

The GetSize macro does not work for you?
CF


No..... it is exactely what we were looking for :)

Thks.

Gal'


thank you very much galevsky