Add fs.split

This commit is contained in:
Corey Johnson
2012-07-03 14:44:41 -07:00
parent 33813d0c42
commit fc660c2790
2 changed files with 14 additions and 0 deletions

View File

@@ -77,6 +77,15 @@ module.exports =
read: (path) ->
$native.read(path)
# Returns an array of path components. If the path is absolute, the first
# component will be an indicator of the root of the file system; for file
# systems with drives (such as Windows), this is the drive identifier with a
# colon, like "c:"; on Unix, this is an empty string "". The intent is that
# calling "join.apply" with the result of "split" as arguments will
# reconstruct the path.
split: (path) ->
path.split("/")
# Open, write, flush, and close a file, writing the given content.
write: (path, content) ->
$native.write(path, content)