Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Many (if not most) applications that process filenames do rely on those being valid text at least in some codepaths and they simply cannot work otherwise. The proper solution is to fail and let the user fix the problem.

Yep, that's what I meant. You need to do what is appropriate to the situation. Ignoring / warning are only two possible handling strategies. In many situations, straight-out failing is another valid one.

A file copy program should just not care and copy the darn thing. A text editor, basically the same, but maybe issue a warning.

Different tasks have different requirements, like the filename being text, the filename not containing spaces, etc. Given that these requirements are somewhat arbitrary, I think it's a fine choice to just not put any non-technical constraints in the guts.

There's an expression for it: Mechanism, not policy. You can always add policy on top, be it in the VFS layer, or as additional programs / classes of programs.

So many potential bugs would be easily fixed if the shell glob ('*') was more configurable.



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

Search: