UNPKG

1.92 kBMarkdownView Raw
1
2[![Build Status](https://secure.travis-ci.org/kriskowal/q-fs.png)](http://travis-ci.org/kriskowal/q-fs)
3
4File system API for Q when/defer-style promises
5
6Open options:
7
8- ``flags``: ``r``, ``w``, ``a``, ``b``
9- ``charset``: default of ``utf-8``
10- ``bufferSize``: in bytes
11- ``mode``: UNIX permissions
12- ``begin`` first byte to read (defaults to zero)
13- ``end`` one past the last byte to read. ``end - begin == length``
14
15Functions:
16
17- ``open(path, options)``
18- ``read(path, options)``
19- ``write(path, content, options)``
20- ``append(path, content, options)`` NOT TESTED
21- ``copy(source, target)`` NOT IMPLEMENTED
22- ``list(path)``
23- ``listTree(path, guard_opt(path, stat)``)
24- ``listDirectoryTree(path)``
25- ``glob(pattern)`` NOT IMPLEMENTED
26- ``match(pattern, file)`` NOT IMPLEMENTED
27- ``makeDirectory(path)``
28- ``makeTree(path)`` NOT TESTED
29- ``remove(path)`` NOT TESTED
30- ``removeTree(path)`` NOT TESTED
31- ``link(source, taget)`` NOT TESTED (probably safe)
32- ``chown(path, uid, gid)`` NOT TESTED (probably safe)
33- ``chmod(path, mode)`` NOT TESTED (probably safe)
34- ``stat(path)``
35- ``statLink(path)`` NOT TESTED
36- ``statFd(fd)`` NOT TESTED
37- ``exists(path)``
38- ``isFile(path)``
39- ``isDirectory(path)``
40- ``lastModified(path)``
41- ``split(path)``
42- ``join(paths)``
43- ``join(...paths)``
44- ``resolve(...paths)``
45- ``normal(...paths)``
46- ``absolute(path)``
47- ``canonical(path)``
48- ``readLink(path)``
49- ``contains(parent, child)``
50- ``relative(source, target)``
51- ``relativeFromFile(source, target)``
52- ``relativeFromDirectory(source, target)``
53- ``isAbsolute(path)``
54- ``isRelative(path)``
55- ``isRoot(path)``
56- ``root(path)``
57- ``directory(path)``
58- ``base(path, extension)``
59- ``extension(path)``
60- ``reroot(path_opt)``
61- ``toObject(path_opt)``
62
63Copyright 2009, 2010 Kristopher Michael Kowal
64MIT License (enclosed)
65