FileClose

Closes a file.

Syntax:

FileClose (filehandle)

Parameters:

(i) filehandle same integer that was returned by FileOpen.

Returns:

(i) always 0.

 

Example:


; the hard way to copy an ASCII file
testfile1=FileLocate("win.ini")
testfile2=StrCat(FilePath(testfile1),"winini.bak")
old = FileOpen(testfile1, "READ")
new = FileOpen(testfile2, "WRITE")
While @TRUE ; Loop till break do us end
   x = FileRead(old)
   If x == "*EOF*" Then Break
   FileWrite(new, x)
EndWhile
FileClose(new)
FileClose(old)
Message("FileClose",StrCat(testfile1,@CRLF,"backed up to",@CRLF,testfile2))
See Also:

FileOpen, FileRead, FileWrite