lkml.org 
[lkml]   [2004]   [Feb]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: JFS default behavior (was: UTF-8 in file systems? xfs/extfs/etc.)
On Mon, 16 Feb 2004 Valdis.Kletnieks@vt.edu wrote:

> Oh?
>
> % rm *
> % touch foo1 bar1 # this calls creat() or open() or similar
> % touch foo2 bar2 # as will this...
> % echo foo* # and this will do a readdir(), presumably
>
> Do you have any expectations what the echo will do? Obviously the glob
> DOES have a relationship with previous shell operations.

Yes, and? One may expect the echo to give "foo1 foo2", but that depends
on a lot of side effect, such as no other processing doing things in
the current directory. The same is true in a program - if you need
to know whether you could create a file, the only sane way is to use
creat() from an application and look at the return value. No other
method is meaningful - arbitrary things can happen between creating
a file and running readdir().

> The point is that *if* we assume that glibc is going to do some magic
> conversion when creating a file, we are assuming that glibc will
> *always* keep the conversion hidden. No matter what. Because the user
> now has expectations of what that file was called when he created it -
> the string he passed to open()/creat(). If what gets handed to the
> kernel is something different, we have to make sure that the user never
> finds out about it.

That way lies madness, I agree. The sane thing (but breaks existing
applications) would be to reject any filename that is not valid
UTF-8, returning -EINVAL. I don't think *that* is going to happen,
though. ;)

--
Ciao,
Pascal
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:01    [W:0.050 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site