\ vandys
7010 7020 thru \ Load filesystem source
Filesystem to be built on top of blocks
Still primarily work in terms of block numbers
Provide "safety net" for block changes for source code blocks
Hierarchy of uses of blocks
Pre-allocation, with block metadata to indicate:
Block in use/valid
Block is available, currently empty
Block is untouchable; sentinel for end of file
Pre-allocation for all "files"
Pre-allocation for "projects"
A project is one or more directory blocks
Directory is a block range followed by a description
Human editable, but also machine readable
Space after directory is allocated sequentially to new objects
Primitives can allocate (directory entry added), insert space, etc.
An entry in a project can point to a sub-project
File metadata indicates directory versus file, etc.
\ vandys
Block access numbering
First, make it easy to access other vocabularies by adding the voc.id
extension so if a string isn't found using the usual search a dot will
make a search in "voc" for "id".
Use a vector which can remap the indicated block #. By default, it's
1:1 with physical disk, but once you active the FS it does a mapping.
So once FS is used, you never use actual block #'s, but instead do
things like:
fs.cd /home/andy
fs.open notes fs.open vi
fs.notes list, fs.notes v, etc.
fs.vi# thru
fs.notes close
Don't let multiple files of same name open at same time. Share vocab
across all sessions. Allocate space when sucking in "fs" definitions,
so nothing's forgotten unless "fs" itself is removed. Need to think
about what techniques needed to thread "fs" specially into dynamic
list of files.
Set CWD to a particular level of the block hierarchy
Open a pair of files, making their basenames visible in the "fs" vocab
The name's action is to push its starting block # on the stack
The name with a hash suffix pushes the low and high blocks of its range
The block is also the index for closing the file.