Old 27th November 2007, 09:09   #1
parasoul
Senior Member
 
Join Date: Aug 2007
Posts: 117
Deleting files with 0 bytes

There a way to delete files that have nothing in them? thank you
parasoul is offline   Reply With Quote
Old 27th November 2007, 10:44   #2
galevsky
Senior Member
 
Join Date: Oct 2007
Posts: 101
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 is offline   Reply With Quote
Old 27th November 2007, 18:43   #3
parasoul
Senior Member
 
Join Date: Aug 2007
Posts: 117
thanks galevsky.

may someone give me an example of that, please?
parasoul is offline   Reply With Quote
Old 27th November 2007, 19:54   #4
galevsky
Senior Member
 
Join Date: Oct 2007
Posts: 101
code:

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.
galevsky is offline   Reply With Quote
Old 27th November 2007, 22:44   #5
CancerFace
Senior Member
 
Join Date: Apr 2006
Posts: 289
Send a message via ICQ to CancerFace
The GetSize macro does not work for you?
CF
CancerFace is offline   Reply With Quote
Old 27th November 2007, 23:35   #6
galevsky
Senior Member
 
Join Date: Oct 2007
Posts: 101
No..... it is exactely what we were looking for

Thks.

Gal'
galevsky is offline   Reply With Quote
Old 28th November 2007, 01:54   #7
parasoul
Senior Member
 
Join Date: Aug 2007
Posts: 117
thank you very much galevsky
parasoul is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump