Skip to content

Latest commit

 

History

History
55 lines (40 loc) · 1.18 KB

file.adoc

File metadata and controls

55 lines (40 loc) · 1.18 KB

FILE

Class that represents file on file system. Available only if 'NXSL.EnableFileIOFunctions' configuration parameter is turned on. File read and write position in file depends on mode file was opened in.

Instance attributes

eof ⇒ Boolean

If it’s already end of file.

name ⇒ String

File name

Instance methods

close() ⇒ void

Close file

read(numberOfSymbols) ⇒ String

Read provided number of bytes from file.

Table 1. Parameters

numberOfSymbols

Integer

Number of symbol to read from file

Return

String with symbols read from file or null if file closed or end of file reached.

readLine() ⇒ String

Read line from file.

Return

String with read line from file or null if file closed or end of file reached.

write(text) ⇒ void

Will write provided text to the file.

Table 2. Parameters

text

String

Text to write in to the file

writeLine(text) ⇒ void

Will write provided text to the file and will add new line at the end.

Table 3. Parameters

text

String

Text to write in to the file