Skip to content

Instantly share code, notes, and snippets.

@louisswarren
Last active March 3, 2017 05:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save louisswarren/16dcb375510cbbe5ea93081cbca9f231 to your computer and use it in GitHub Desktop.
Save louisswarren/16dcb375510cbbe5ea93081cbca9f231 to your computer and use it in GitHub Desktop.
Setfs

Replace hierarchical directories with categories.

Categories

/foo - Contains all files in the category foo.

/foo/bar - Contains all files in the intersection of category foo and category bar.

/bar/foo - Equivalent to /foo/bar.

/foo+bar/ - Files in the union of categories foo and bar. Of course, new files cannot be created in this union, as it is non-constructive.

Using a program like ls will list those files matching the chosen category restrictions, as well as all further categories by which these files may be separated. For example, consider a file system as follows:

$ ls /foo/bar
 apple
 banana

$ ls /foo/baz
 /pop
 banana
 cherry

$ ls /foo/baz/pop
 pear

Then

$ ls /foo
 /bar
 /baz
 /pop
 apple
 banana
 cherry
 pear

Queries

Query categories are computed as they are used. Some examples:

/ext:md/ - Files with the extension .md

/ext?/ - All files with extensions, and a category for each extension they have

/ext?/md/ - Equivalent to /ext:md/

/executable?? - Files which the current user can execute

/executable?! - Files which the current user cannot execute

/executable? - All files, and categories true and false corresponding to the two queries above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment