File.open
From FreeSWITCH Wiki
(Redirected from Javascript File open)
Opens a file handle
[edit]
Synopsis
open(mode)
- mode - a comma seperated list of the file modes
- read - open for reading
- write - open for writing
- readWrite - open for reading and writing
- append - add to the end of a file
- create - create the file if it doesnt exist
- replace - replace the contents with new ones (truncate)
- autoflush - auto flush the buffer when writing
[edit]
Example
var fd = new File("/tmp/blah");
fd.open("read,write,create");
// Read output from an application
var fd = new File("|ls /home");
fd.open("read");
var result = fd.read("128");
[edit]
