Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Simpler FileSystem Interface proposal

Name: Old !r4lisp/Hag 2012-06-19 11:34

POSIX-style filesystems suffer from backwards compatibility. The tree interface as well as symbolic links pose are solid performance challenges and pathnames can be very cumbersome to manipulate for no real benefits. Banks and files form the basis to SFSI as opposed to the directories, files and symbolic links from the traditional model. Our design goal is to simplify and flatten as much as possible the current interface.
A bank is defined to be an array of files. Bank and files have  attributes and permissions similar to those defined by POSIX. A bank can be located in a filesystem by number or by name. A file can be located in a bank by number or by name. Banks can't contain other banks and are intended to represent mountpoints or collections of related files.
We encourage system designers to standardise bank numbers for specific purposes as with the system directories of traditional filesystems. Systems should provide tools to create mountpoints and other kinds of virtual banks. We expect programs to use relative file numbers within a bank and users to use file and bank names.
POSIX-based archiver programs must deflate files in such a way that files in the same directory use contiguous numbers within a bank and have their numbers ordered depending on the Unicode code points which form their names, with lower code points corresponding to lower numbers and the first characters being assigned a higher weight. This behaviour allows bundles of files to keep relative references between themselves

C entry points:
int sfsiBindBank(unsigned int id, int flags);
Binds the bank with number id as current and returns 1 on success, 0 on error.

int sfsiBindBankByName(const char* id, int flags);
Binds the bank with name id as current and returns 1 on success, 0 on error.

int sfsiOpenFile(unsigned int id, int flags);
Opens the file with number id in the current bank and returns a POSIX file descriptor if successful or -1 otherwise.

int sfsiOpenFileByName(const char* id, int flags);
Opens the file with name id in the current bank and returns a POSIX file descriptor if successful or -1 otherwise.

int sfsiFileBank(int fd);
Returns the bank which contains the file described by the POSIX file descriptor fd.

int sfsiFileNumber(int fd);
Returns the number of the file described by the POSIX file descriptor fd within its bank.

[code]int sfsiProcessFileNumber(void);[code]
Returns the number of the file which contains the process image being run by the caller thread within its bank, or 0 if no process image corresponds to the caller thread.

[b]flags[/b] is one of [b]O_RDONLY[/b], [b]O_WRONLY[/b] or [b]O_RDWR[/b] which request opening the file or bank read-only, write-only or read/write, respectively, bitwise or'd with zero or more of the following POSIX flags: [b]O_CREAT[/b], [b]O_EXCL[/b], [b]O_TRUNC[/b], [b]O_APPEND[/b], [b]O_NONBLOCK[/b], [b]O_SYNC[/b], [b]O_DIRECT[/b], [b]O_ASYNC[/b].

Name: Anonymous 2012-06-21 13:18


Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List