Nasal library/io: Difference between revisions

→‎Functions: Start open()
(→‎load_nasal(): Add examples)
(→‎Functions: Start open())
Line 103: Line 103:
}}
}}


=== open(filename, mode="r") ===
=== open() ===
Opens the file with the specified mode (as per ANSI fopen()) and returns a ghost object representing the filehandle. Failures are thrown as runtime errors as per die().  
{{Nasal doc
|syntax = io.open(path[, mode]);
|text = Opens the file with the specified mode and returns an <code>iofile</code> ghost object representing the file.
|param1 = path
|param1text = Full
|param2 = mode
|param2text =
|example1 =
}}


=== read(filehandle, buf, len) ===
=== read(filehandle, buf, len) ===