Post 9thfhBKFSOdBDxnS3E by wolf480pl@mstdn.io
 (DIR) More posts by wolf480pl@mstdn.io
 (DIR) Post #9tgzx4W1oZssYsOnp2 by wolf480pl@mstdn.io
       2020-04-04T07:10:05Z
       
       0 likes, 0 repeats
       
       Filesystems should never interpret file names as text. They should treat it as an opaque bytestring, possibly with some disallowed/special bytes for separators.
       
 (DIR) Post #9theHEELvyq0ka6FIO by ignaloidas@mastodon.gamedev.place
       2020-04-04T14:41:53Z
       
       0 likes, 0 repeats
       
       @wolf480pl Filesystems should be just a key-value database storage format.
       
 (DIR) Post #9thfhBKFSOdBDxnS3E by wolf480pl@mstdn.io
       2020-04-04T14:57:49Z
       
       0 likes, 0 repeats
       
       @ignaloidas that's not a filesystem.But you can make a filesystem on top of a key-value store.Eg. if your key->value paris are like(dir_inode, child_file_name)->child_inode
       
 (DIR) Post #9thfqVfVBz4MvGBaQS by ignaloidas@mastodon.gamedev.place
       2020-04-04T14:59:30Z
       
       0 likes, 0 repeats
       
       @wolf480pl I'd argue that is all of the things the filesystem should define. Any more and the filesystem starts being hard to generalize to other operating systems.
       
 (DIR) Post #9thftafn2dmxJSn0tM by wolf480pl@mstdn.io
       2020-04-04T15:00:03Z
       
       0 likes, 0 repeats
       
       @ignaloidas so you're saying hierarchical trees are fine, but permissions, modification times, etc. are not?
       
 (DIR) Post #9thfyaWd1CemIot4eO by wolf480pl@mstdn.io
       2020-04-04T15:00:58Z
       
       0 likes, 0 repeats
       
       @ignaloidas or are you saying that even making a directory hierarchy on top of a K-V store the way I described is not portable?
       
 (DIR) Post #9thrsLGu17ZyhsJt56 by ignaloidas@mastodon.gamedev.place
       2020-04-04T17:14:15Z
       
       0 likes, 0 repeats
       
       @wolf480pl Embedded systems have filesystems, but dealing with dir chains may be too slow. So yes, I'd argue that directories are not portable.
       
 (DIR) Post #9thvUm9wnT46xr5Jcu by wolf480pl@mstdn.io
       2020-04-04T17:54:52Z
       
       0 likes, 0 repeats
       
       @ignaloidas I'd argue that only having portable filesystems is useless.
       
 (DIR) Post #9tmEsHg2SNTr8VrGFM by loziniak@quitter.pl
       2020-04-06T19:50:42Z
       
       0 likes, 0 repeats
       
       @wolf480pl What's wrong with text?
       
 (DIR) Post #9tmFCcqxQyTkbXfHpw by wolf480pl@mstdn.io
       2020-04-06T19:54:31Z
       
       0 likes, 0 repeats
       
       @loziniak you mean like, interpreting sequences of bytes as ascii or unicode characters?Rejecting invalid utf-8 sequences, doing case-insensitive comparisons, and other stuff like that?
       
 (DIR) Post #9tmMi1wetNAv59FmIi by loziniak@quitter.pl
       2020-04-06T21:18:31Z
       
       0 likes, 0 repeats
       
       @wolf480pl So, mostly for performance reasons?
       
 (DIR) Post #9tmMlwlk4vpUBf0zWS by wolf480pl@mstdn.io
       2020-04-06T21:19:21Z
       
       0 likes, 0 repeats
       
       @loziniak no. To avoid the temptation to add stupid misfeatures.
       
 (DIR) Post #9tmMsxssKb0LfkhKXA by wolf480pl@mstdn.io
       2020-04-06T21:20:37Z
       
       0 likes, 0 repeats
       
       @loziniak and to avoid the complexity and edge cases
       
 (DIR) Post #9tmNsKuBLzukjfZbKy by wolf480pl@mstdn.io
       2020-04-06T21:31:41Z
       
       0 likes, 0 repeats
       
       @loziniak like, if you treat it as a byte string, it works no matter if the user wants to use utf-8 or iso-8859-2 or even sth obscure like cp852.But if you decide to interpret it as characters, then the filesystem implementation needs to decide on an encoding, handle the cases of incorreclty encoded names, handle the cases of names that can't be encoded in the target encoding, etc. Lots of complexity, and less flexibility.
       
 (DIR) Post #9tmNtTTixpwBcAjySG by loziniak@quitter.pl
       2020-04-06T21:31:50Z
       
       0 likes, 0 repeats
       
       @wolf480pl But names are text. They are for humans, they have meaning, so they need to be coded in some human language, hence UTF8 and case-insensitivity. You have to be able to display it properly.Perhaps there should be two properties of a file: a name (text) and id (binary)?Reminds me of this guy proposing rewriting the Internet with binary protocols:blog.plan99.net/what-should-fo…
       
 (DIR) Post #9tmNx4wq6qjIh34sIS by wolf480pl@mstdn.io
       2020-04-06T21:32:34Z
       
       0 likes, 0 repeats
       
       @loziniak if a user wants to use human-readable names encoded in utf-8, they're free to.Also, case-insensitive names can be confusing for humans.
       
 (DIR) Post #9tmOvyF7eZORYvfHOa by loziniak@quitter.pl
       2020-04-06T21:43:15Z
       
       0 likes, 0 repeats
       
       @wolf480pl If you want binary name to be read as text, probably you have to store an info about encoding somewhere. Things are getting more complicated. If one app encodes name in UTF8, how will other app know how to decode it?I'd say case-insensitive is very human-like. HElP.txt and HeLP.txt being different files is not really straight-forward.
       
 (DIR) Post #9tmP5xWDCXrWDBQATI by wolf480pl@mstdn.io
       2020-04-06T21:45:23Z
       
       0 likes, 0 repeats
       
       @loziniak >you have to store an info about encoding somewherenot if all apps in the system use the same encoding.
       
 (DIR) Post #9tmQoMnKgcNZIfAUYC by loziniak@quitter.pl
       2020-04-06T22:04:08Z
       
       0 likes, 0 repeats
       
       @wolf480pl But you can't be certain about that. Filesystem is meant to be used in various environments. You don't control user's apps. And what if you move your filesystem to another computer, eg. on flash drive?
       
 (DIR) Post #9tnDNIO5rKzVZD5Gc4 by wolf480pl@mstdn.io
       2020-04-07T07:08:44Z
       
       0 likes, 0 repeats
       
       @loziniak >Filesystem is meant to be used in various environmentsNo.If you mount a filesystem in one system, write some files, then mount that same filesystem in another system, and try to read those files, the file ownership will likely be wrong.There is a subcategory of filesystems suitable for moving data between different systems (eg. FAT or ISO9660), but those filesystems have to have very limited capabilities.
       
 (DIR) Post #9tnDazQFAWAinjcTKq by wolf480pl@mstdn.io
       2020-04-07T07:11:14Z
       
       0 likes, 0 repeats
       
       @loziniak As for apps - you do control them.They're all compiled with the target system in mind, either by distro maintainers or by the user.They all link against system libraries, which read /etc/locale.conf and the LANG environment variable.But there's still the option of passing through filenames as strings of bytes if a particular app doesn't need to display filenames on the screen.