Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What I want is to specify that for a directory, every file creation/modification within said directory will be checked by the kernel and if the filename has unsupported characters the offending process will be given a "permission denied" error.

I was thinking about writing a fuse-driver that rejects non-compliant filenames. But that does not seem practical.

I am not looking for solutions that recommend things like a cronjob or inotify that clean up unwanted characters after-the fact. I'm looking for something that is preemptively preventative.

share|improve this question
What filesystem are you using? mount has some file system specific options that could (I said could, never tried it) help. Search man mount for unicode or utf8. – terdon Mar 4 '13 at 15:10
I'm using ext4. I read the manpage: nothing interesting. The classic unix way regarding filenames is not to care about them at all, as long as they don't contain / or the 0-byte. I have never heard of the feature I'm requesting, thus my question. – life of pi Mar 4 '13 at 15:23
What does "unicode filename" even mean in this context? Do you want to ensure all filenames are valid UTF-8? – Cairnarvon Mar 4 '13 at 15:54
Yes. sorry I didn't say that. – life of pi Mar 4 '13 at 16:16
You're out of luck - the filesystem doesn't have a concept of "character set", filenames are simply byte sequences, with only / and \0 disallowed, as you say. You'd need to intercept all filename creation calls (linking, renaming, creating), either at the filesystem layer or by changing glibc (directly or monkey-patching via LD_PRELOAD - that one's easier to do and hard to enforce). There's no "intended" way to do this. – Gabe Apr 26 '13 at 12:50

ZFS has mechanisms for making datasets (and maybe pools) be UTF8 only, potentially with different normalization mechanisms.

Further reading:

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .