IO::OpenFile
- IO::OpenFile(fileName, openingMode) ⇒ FILE
-
Open file. Returns FILE object or null.
In server scripts,
IO::functions are available only if server configuration variableNXSL.EnableFileIOFunctionsis enabled (change requires server restart). They are always available in scripts run bynxscript.Table 1. Parameters fileName
String
File name to open.
openingMode
String
Optional, default
"r". Mode file should be opened in. More can be found there.ReturnFile class or
NULLif error occurred.f = IO::OpenFile("/tmp/a.txt", "r"); while (!f.eof) println(f.readLine()); // Will print contents of the file