fs.q

The filesystem: .fs.exists, .fs.isfile, .fs.isdir, .fs.size answer for a path, a symbol or a list of them; .fs.remove deletes the files named and .fs.rmdir the empty directories named - never anything below them.
  • 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

EntitiesShort 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:
  • p - (any) a path, a string or a symbol - or a list of them

.fs.isdir[p]

whether the path names a directory - an EMPTY one still is one.

Parameters:
  • p - (any) a path, a string or a symbol - or a list of them

.fs.isfile[p]

whether the path names a regular file.

Parameters:
  • p - (any) a path, a string or a symbol - or a list of them

.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:
  • p - (any) a path, a string or a symbol - or a list of them

.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:
  • p - (any) a path, a string or a symbol - or a list of them

.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:
  • p - (any) a path, a string or a symbol - or a list of them