Post AdJClk76ezCEN763Ky by a@social.exozy.me
(DIR) More posts by a@social.exozy.me
(DIR) Post #AbHWPfEyzoF6OdbxBY by a@social.exozy.me
2023-10-30T02:23:45Z
0 likes, 1 repeats
Today I learned that the max file length for most Linux filesystems is 255 bytes, and although I can't think of any legitimate uses for filenames longer than that, this limit seems a bit small...I ran into this limit when yt-dlp-ing a video whose name had a lot of CJK characters, but even 255 bytes/(3 bytes per CJK character) = 85 characters is an unnecessarily long filename.
(DIR) Post #AbHdqjZxfoKBLjHLcG by a@social.exozy.me
2023-10-30T03:47:01Z
0 likes, 0 repeats
I truncated the filenames to 255 bytes now Nextcloud is spitting errors when trying to sync the files because the server appends an .ocTransferId1858550097.part to the end of the file during the transfer. Welp, time to truncate the filenames even more.
(DIR) Post #AbHsFvqMbs5Dz8rOZk by lil5@fosstodon.org
2023-10-30T06:28:26Z
0 likes, 0 repeats
@a unhelpful advice:You could use the #ReiserFS #filesystem it has a max file length of 4032But it is vulnerable to the year 2038 overflow and 2025 Linux kernel removal But I bet you love to life dangerously :Blobhaj_Ghostie_Alive:
(DIR) Post #AbJdYZUGqPNR9bsNrE by a@social.exozy.me
2023-10-31T02:53:11Z
0 likes, 0 repeats
This reminds me of how Linux also has a 4096 byte limit for the length of the full file paths. One of my friends once tried creating a bunch of nested folders to get to that limit, and it ended up breaking *Nix*, because they were running zsh installed using Nix and having zsh's cwd as a 4096-byte path was enough to cause Nix to do weird things. This took a lot of strace-ing to debug.
(DIR) Post #AbJeDdnnhpmuPSavlw by a@social.exozy.me
2023-10-31T03:00:37Z
0 likes, 0 repeats
basically, there will always be corner cases that you will never think of. Having a 255 byte long filename sounds ridiculous until you remember that CJK characters need 3 bytes in UTF-8, at which point it because a lot easier to hit that limit, which no one probably considered when setting the 255 byte limit. If you have a shell script that does `cp "$i" "$i.bak"; mess-around-with "$i"`, you could totally screw yourself over if $i happens to be 255 bytes long.
(DIR) Post #AdJClk76ezCEN763Ky by a@social.exozy.me
2023-12-29T17:37:15Z
0 likes, 0 repeats
Interestingly, btrfs can support filenames up to 1023 bytes instead of 255, but this requires a patched kernel.https://old.reddit.com/r/linuxquestions/comments/zlvolo/japanese_filenames_and_the_255_character_limit/j0demqt/