Archive: Filewrite, fileopen, fileclose???


Filewrite, fileopen, fileclose???
Hello,

Can someone give me an example about these functions?

FileOpen

FileWrite

FileClose

and what is
user_var(handle output) in fileopen?


Asch


When you do FileOpen $0 "filename" the $0 is the "handle" you then use to refer to the opened file when you read, write or close the file, e.g. FileClose $0.


RE: Fileopen, filewrite, fileclose
Hello,

Thanks sunjammer.

here is my codes:
function "creatdir"
strcpy $INSTDIR "C:"
fileopen $0 "$INSTDIR\temp\nsis.log" a

createdirectory "$INSTDIR\temp\copy"
copyfiles /silent "$INSTDIR\temp\*.txt" "$INSTDIR\temp\copy" 50
setoutpath "$INSTDIR\temp"

filewrite $1 "1)directories created$\n"
filewrite $2 "2)files copied$\n"
fileclose $3

functionend

I just figured that out too, it needs variable to hold that place but its not writing to that file in temp dir.

HUM...

Maybe the variables needs to be the same.



Asch


Hello,

My final words are:

It does needs to be the same variable inorder to write to a file.

I can't quite figure out how to log using logset on and logtext "log dammit", but i guess this way i can log in my own terms.

hehehehe

asch


You could have searched the archive and find:
http://nsis.sourceforge.net/archive/....php?pageid=17
;)


If your trying to log all the stuff into a file, then use KiCHiK's Log Script that he wrote for me (Thanx dude :))
It will dump the LogWindow text on the installfiles page to a file.

http://nsis.sourceforge.net/archive/...instances=0,11

Insert the function then use...


GetTempFileName $0
Push $0
Call DumpLog
Delete "$INSTDIR\temp\nsis.log" #deletes old log file
Rename "$0" "$INSTDIR\temp\nsis.log" #makes tempfile as nsis.log

...in a section (preferably after all the other sections.)

-Stuart