1
0
Fork 0

Added missing methods to fs module. fix #978

This commit is contained in:
Thomas Schmidts 2014-08-05 13:37:40 +02:00
parent bf8ea5de4b
commit baf6635627
2 changed files with 37 additions and 4 deletions

View File

@ -40,12 +40,43 @@ The implementation follows the CommonJS specification
@startDocuBlock JS_Read
<!-- lib/V8/v8-utils.cpp -->
@startDocuBlock JS_Read64
<!-- lib/V8/v8-utils.cpp -->
@startDocuBlock JS_Remove
<!-- lib/V8/v8-utils.cpp -->
@startDocuBlock JS_MakeDirectory
<!-- lib/V8/v8-utils.cpp -->
@startDocuBlock JS_GetTempFile
<!-- lib/V8/v8-utils.cpp -->
@startDocuBlock JS_GetTempPath
`fs.join(path, filename)`
The function returns the combination of the path and filename, e.g. fs.join(Hello/World, foo.bar) would return Hello/World/foo.bar.
`fs.pathSeparator`
If you want to combine two paths you can use fs.pathSeparator instead of */* or *\\*.
<!-- lib/V8/v8-utils.cpp -->
@startDocuBlock JS_Size
<!-- lib/V8/v8-utils.cpp -->
@startDocuBlock JS_RemoveDirectory
`fs.write(filename, content)`
Writes the content in a file.

View File

@ -1003,6 +1003,7 @@ static v8::Handle<v8::Value> JS_Getline (v8::Arguments const& argv) {
/// `fs.getTempPath()`
///
/// Returns the absolute path of the temporary directory
///
/// @endDocuBlock
////////////////////////////////////////////////////////////////////////////////
@ -1173,7 +1174,7 @@ static v8::Handle<v8::Value> JS_MakeAbsolute(v8::Arguments const& argv) {
////////////////////////////////////////////////////////////////////////////////
/// @brief returns the directory listing
/// @startDocuBlock JS_List
/// `fs.list(path`
/// `fs.list(path)`
///
/// The functions returns the names of all the files in a directory, in
/// lexically sorted order. Throws an exception if the directory cannot be
@ -1706,7 +1707,7 @@ static v8::Handle<v8::Value> JS_MarkNonce (v8::Arguments const& argv) {
/// @startDocuBlock JS_Move
/// `fs.move(source, destination)`
///
/// Moves *source to destination. Failure to move the file, or
/// Moves *source* to destination. Failure to move the file, or
/// specifying a directory for target when source is a file will throw an
/// exception.
/// @endDocuBlock
@ -2032,6 +2033,7 @@ static v8::Handle<v8::Value> JS_Remove (v8::Arguments const& argv) {
///
/// Removes a directory if it is empty. Throws an exception if the path is not
/// an empty directory.
///
/// @endDocuBlock
////////////////////////////////////////////////////////////////////////////////