fs.q
- implNote - Every path argument converts through .path.path, so .fs takes a string, a symbol or a path and inherits .path's refusal of `:pq: provider handles and scheme:// URLs. The names are Python's os/shutil/tempfile spellings. .fs.remove and .fs.rmdir are one hdel per element, and hdel's refusal of a populated directory is their whole guard; .fs.rmtree is the ONE recursive delete, and native, because a q walk over `key` follows links.
Entity Summary
| Entities | Short Description |
|---|---|
| .fs.exists[p] | whether the path names anything at all, file or directory. |
| .fs.gettempdir[] | the directory temporary files belong in: the first of the TMPDIR, TEMP and TMP environment variables that is set and not empty, else "/tmp". |
| .fs.isdir[p] | whether the path names a directory - an EMPTY one still is one. |
| .fs.isfile[p] | whether the path names a regular file. |
| .fs.mkdtemp[] | a new, empty directory under .fs.gettempdir[], its path as a string. |
| .fs.remove[p] | delete ONE file. |
| .fs.rmdir[p] | delete ONE EMPTY directory. |
| .fs.rmtree[p] | delete a directory and everything in it, answering its path; a link inside it, or named, is removed and never followed. |
| .fs.size[p] | the file's size in bytes. |
| .fs.walk[p;pattern] | the files at any depth under a directory whose names match a `like` pattern, as strings relative to it, in `key` order. |
Entity Details
.fs.exists[p]
whether the path names anything at all, file or directory.
| Parameters: |
|
|---|
.fs.isdir[p]
whether the path names a directory - an EMPTY one still is one.
| Parameters: |
|
|---|
.fs.isfile[p]
whether the path names a regular file.
| Parameters: |
|
|---|
.fs.remove[p]
delete ONE file. A directory is 'domain whether it is empty or not: remove is the file verb, and letting hdel answer would quietly delete an empty directory. A missing path is hdel's own 'io.
| Parameters: |
|
|---|
.fs.rmdir[p]
delete ONE EMPTY directory. A file is 'domain: rmdir is the directory verb. A POPULATED directory is hdel's own 'io and survives intact - the engine's refusal to recurse is the guard, and it is passed through untouched.
| Parameters: |
|
|---|
.fs.rmtree[p]
delete a directory and everything in it, answering its path; a link inside it, or named, is removed and never followed. A file, a root, the working directory or any directory above it is 'domain; a missing path is 'io.
| Parameters: |
|
|---|
.fs.size[p]
the file's size in bytes. A directory is NOT refused and does NOT answer the size of its contents - hcount hands back the OS's own directory-entry size, exactly as Python's os.path.getsize does. A missing path is 'io.
| Parameters: |
|
|---|
.fs.walk[p;pattern]
the files at any depth under a directory whose names match a `like` pattern, as strings relative to it, in `key` order. A file answers its own name when it matches; an empty directory or a missing path answers ().
| Parameters: |
|
|---|