> The order of files/directories within a directory, which can be
> seen with ls -f, affects the order you get using the opendir() and
> readdir() functions in C.  What is this order based on, and is
> there anyway to change it?

This is the "native" order of underlying filesystem. You have no way
to influence it (unless specific filesystem provides some way).

You may try to create specific entries one-by-one, e.g.

mkdir new-foo
mv foo/bar1 new-foo
mv foo/bar2 new-foo
...

but filesystem is free to put them in any order (consider something
like tree to speed up search ...).

Why would you need it?

-andrey

Reply via email to