mirror of https://gitee.com/bigwinds/arangodb
82 lines
1.3 KiB
Plaintext
82 lines
1.3 KiB
Plaintext
!CHAPTER Module "fs"
|
|
|
|
!SUBSECTION File System Module
|
|
|
|
The implementation follows the CommonJS specification
|
|
[Filesystem/A/0](http://wiki.commonjs.org/wiki/Filesystem/A/0).
|
|
|
|
|
|
<!-- lib/V8/v8-utils.cpp -->
|
|
|
|
@startDocuBlock JS_Exists
|
|
|
|
|
|
<!-- lib/V8/v8-utils.cpp -->
|
|
|
|
@startDocuBlock JS_IsDirectory
|
|
|
|
|
|
<!-- lib/V8/v8-utils.cpp -->
|
|
|
|
@startDocuBlock JS_IsFile
|
|
|
|
|
|
<!-- lib/V8/v8-utils.cpp -->
|
|
|
|
@startDocuBlock JS_List
|
|
|
|
|
|
<!-- lib/V8/v8-utils.cpp -->
|
|
|
|
@startDocuBlock JS_ListTree
|
|
|
|
|
|
<!-- lib/V8/v8-utils.cpp -->
|
|
|
|
@startDocuBlock JS_Move
|
|
|
|
|
|
<!-- lib/V8/v8-utils.cpp -->
|
|
|
|
@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. |