Skip to content
⌘ NSIS Forum Archive

Deleting files with 0 bytes

7 posts

parasoul#

Deleting files with 0 bytes

There a way to delete files that have nothing in them? thank you
galevsky#
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'
galevsky#

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.