The following are the File object functions for COD scripts.

Please take notice of the following notes…

(a) – Undocumented in prior Autodesk documentation

FunctionNotesExampleDescription
close<file>.close()True/False
delete<file>.delete(<boolean>)
<file>.delete()
<file>.delete(True)
True/False
fileobject myfile = new file("<file>",<mode>)
object myfile as file("<file>",<mode>)
<object>
open<file>.open("<file>",<mode>)
<file>.open("c:/myfile.txt",forinput)
True/False
readbyte<file>.readbyte()<numeric>
readchar<file>.readchar()<string>
readint<file>.readint()<numeric>
readline<file>.readline()<string>
readreal<file>.readreal()<numeric>
readstring<file>.readstring()<string>
readword<file>.readword()<numeric>
rename<file>.rename("<string>")
<file>.rename("C:\MyRenamedFile.txt")
True/False
seekentry(a)<file>.seekentry("[string]")
<file>.seekentry([number])
True/False
seekline(a)<file>.seekline("[string]")
<file>.seekline([number])
True/False
writebyte<file>.writebyte(<number>)True/False
writechar<file>.writechar("<string>")True/False
writeint<file>.writeint(<number>)True/False
writeline<file>.writeline("<string>",<boolean>)
<file>.writeline("ABCdef")
<file>.writeline("ABCdef", True)
<integer>
writereal<file>.writereal(<number>)True/False
writestring<file>.writestring("<string>")True/False
writeword<file>.writeword(<number>)True/False