[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: readdir() on linux
Thank you Edmund,
So, that means that there is no way for me to understand the encoding
unless I look at some mount options ... right?
marco
On Tue, 3 Dec 2002, Edmund GRIMLEY EVANS wrote:
> marco <mmechelli@xxxxxxxxxx>:
>
> > I need to make a scan of all the files on a Linux system (independently
> > of the type of filesystem and the options given at mount time) and record
> > all the filenames. I'm using the readdir() syscall that returns a pointer
> > to a struct dirent. My question is: what should I assume about the
> > format/encoding of the d_name[] field?
>
> Assume it's a null-terminated octet string. It shouldn't be empty, and
> it shouldn't contain (ASCII) '/'. You can't assume the string is valid
> character data in any particular encoding. However, if it is valid as
> UTF-8, then it probably really is UTF-8, but it might not be
> printable, so you'll still have to process it before displaying it.
>
> Edmund
> --
> Linux-UTF8: i18n of Linux on all levels
> Archive: http://mail.nl.linux.org/linux-utf8/
>
>
>
---------------------------------------------------
~
. .
/V\ Computers are like air conditioners.
// \\ They stop working when you open Windows.
/( )\
^`~'^
--
Linux-UTF8: i18n of Linux on all levels
Archive: http://mail.nl.linux.org/linux-utf8/