Old 18th April 2008, 13:44   #1
sukram
Junior Member
 
Join Date: Apr 2008
Posts: 3
Post Delete not working as intended

Hey all,

I'm trying to delete files in a loop, but the files don't get deleted for some reason.
If someone could please point me into the right direction...?!
code:

fileLoop:
FileRead $INSTALL_LOG $R0
${If} $R0 == "[STOP] Install"
goto dir
${Else}
; Determine if file or directory
StrCpy $R2 $R0 3
StrCpy $R3 $R0 "" 4
${If} $R2 == "[F]"
; not working even though the value in $R3 seems to be correct
Delete $R3
${EndIf}
goto fileLoop
${EndIf}



Edit: Removed unneccessary FileRead

Last edited by sukram; 18th April 2008 at 14:23.
sukram is offline   Reply With Quote
Old 18th April 2008, 13:54   #2
fabian.rap.more
Senior Member
 
Join Date: Dec 2007
Posts: 111
Send a message via Yahoo to fabian.rap.more
you must ensure that the file is not in use at the time

What some invent the rest enlarge
fabian.rap.more is offline   Reply With Quote
Old 18th April 2008, 13:55   #3
sukram
Junior Member
 
Join Date: Apr 2008
Posts: 3
It is definately not in use at the time.
sukram is offline   Reply With Quote
Old 18th April 2008, 15:12   #4
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
You need to use TrimNewLines on it.
Not sure what the StrCpy $R3 $R0 "" 4 is for?

Stu
Afrow UK is offline   Reply With Quote
Old 21st April 2008, 09:17   #5
sukram
Junior Member
 
Join Date: Apr 2008
Posts: 3
Thanks a lot, that did the trick

That just extracts the file's/directory's name.
sukram 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