Re: Filenames, escaping, and GtkFileSystem



On Wed, 2004-03-24 at 22:55, Federico Mena Quintero wrote:

> 2. Specify that GtkFileSystem::make_path() must escape the filename,
> thus allowing any characters to appear in it, *and* then unescaping
> filenames when reading them from the file system.  This would make it
> possible to have file names like "Report from the engineering/marketing
> teams" above.  If we do this, we should modify Nautilus as well.
> 
> I'm not sure what is the right thing to do.  People get unhappy if there
> are useful characters that they can't put in filenames, but doing
> escaping/unescaping everywhere a) goes against what every program does;
> b) may break applications which do filename munging on their own.

Escaping filenames manually like that seems pretty broken to me. You'll
never know if a / in a file was a directory or a to-be-escaped slash.
It'll be extra confusing if you have a slash in a directory name. Just
consider the expensive stat walk you have to do to find out the real
path for "/some/dir/folder/with/a/file" (where dir/folder is a filename)
(and this is ignoring the fact that such a path could resolve to several
files!). 

Furthermore this escaping is not done by any other application in the
system, and we're bound to forget it all over the place ourselves, so
it'll never be really consistant. "/" is forbidden in file names in
unix, we'll just have to get over it.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's a war-weary small-town cyborg with a passion for fast cars. She's a 
wealthy punk museum curator who believes she is the reincarnation of an 
ancient Egyptian queen. They fight crime! 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]