fs.q
- implNote - THE .fs surface: the read-safe view of the filesystem, plus deletion bounded to the objects NAMED - one hdel per element, so a vector argument deletes exactly its own elements and never a level below any of them. 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. Portable q - key, hcount and hdel are all standard kdb, so nothing here calls the peachq C surface; the names are Python's os/os.path spellings. NOTHING HERE RECURSES: hdel refuses a populated directory itself, and that refusal is the whole guard - inherited, never re-worded. Definitions only.
Entity Summary
| Entities | Short Description |
|---|---|
| .fs.exists[p] | whether the path names anything at all, file or directory. |
| .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.remove[p] | delete ONE file. |
| .fs.rmdir[p] | delete ONE EMPTY directory. |
| .fs.size[p] | the file's size in bytes. |
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.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: |
|
|---|