Nasal library/io: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
m (→Reading files) |
||
Line 5: | Line 5: | ||
== Writing files == | == Writing files == | ||
== Reading files == | == Reading files == | ||
=== io.basename() === | |||
Works like standard Unix command basename. Returns the file name from a given path. | |||
<syntaxhighlight lang="nasal"> | |||
io.basename(<path>); | |||
</syntaxhighlight> | |||
=== io.dirname() === | |||
Works like standard Unix command dirname. Returns the directory part from a given path. | |||
<syntaxhighlight lang="nasal"> | |||
io.basename(<path>); | |||
</syntaxhighlight> | |||
=== io.readfile() === | |||
Reads and returns a complete file as a string. | |||
<syntaxhighlight lang="nasal"> | |||
io.readfile(file); | |||
</syntaxhighlight> | |||
== XML == | == XML == | ||
== Serializing Nasal types == | == Serializing Nasal types == |
Revision as of 16:00, 21 May 2016
Work in progress This article or section will be worked on in the upcoming hours or days. See history for the latest developments. |
The FlightGear forum has a subforum related to: Nasal Scripting |
Nasal scripting |
---|
Nasal internals |
---|
Memory Management (GC) |
Creating files
Writing files
Reading files
io.basename()
Works like standard Unix command basename. Returns the file name from a given path.
io.basename(<path>);
io.dirname()
Works like standard Unix command dirname. Returns the directory part from a given path.
io.basename(<path>);
io.readfile()
Reads and returns a complete file as a string.
io.readfile(file);