Hacker News new | past | comments | ask | show | jobs | submit login

The Filesystem != Files.

The File is one of the most important core abstractions of our computer systems. Stdin? Stdout? Network I/O? Etc. All files.




Actually no, they are file descriptors. They provide a unique identifier, which used in conjunction with an API call, with operate on the data in, or the meta data of a data set.

And while its true that UNIX (and taken to its logical extreme Plan 9) used a common API to handle all of the transfers between non-memory resident data sets and memory, there are many examples of operating systems that use other schemes. One of my favorites which I got to help build when I was in the kernel group at Sun was a thing called 'mmap' which assigned addresses in your memory space to locations on disk. The 'magic' happened in the VM HAT layer. That scheme is having something of a comeback in 64 bit address processors since few machines actually have 22PB of RAM it is possible to do something like:

    struct Stuff *my_stuff;
    mmap((void *)my_stuff, file_len, 0, 0, file, 0);
And then be able to make a statement

    if ((my_stuff+100)->is_ready) { ... }
 
And have the operating system translate between my notion of a memory address and the data sets offset to instance 100 of the structures contained therein.

I expect to see more of that in experimental OS code. Something like char data_file = ChuckOSOpen("some.dat"); which lets me then address data_file like an array of char so

   while (char *t = data_file, IsValid(t), t++) { ... }; 
would then iterate over the contents of data_file as 8 bit values until there wasn't any more data and thus no more validly mapped pages. Read and write are simply assignment, seek is simply math, and close is simply unmap.

All without the notion of 'files' but with a notion of 'named data sets' which clearly can be implemented in a number of ways.


> Actually no, they are file descriptors

That is a distinction without a difference.


Without distinction? Only if you look at it simplistically, form the view of a single process. Otherwise:

- Shutdown a machine, and all file descriptors are gone. It's files, one would expect, would still be there.

- you can have multiple file descriptors for a single file.

- you can have file descriptors that aren't 'attached' to a file proper (stdin, stout)




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: