directory order of files

directory order of files

Post by Edmund GRIMLEY EVAN » Sat, 30 Jun 2001 18:30:07



With Linux ext2, and some other systems, when you create files in a
new directory, the file system remembers their order:

$ mkdir new
$ cd new
$ touch one two three four
$ ls -U
one  two  three  four

(1) Is there any standard that says a system should behave this way?
Is there any software that depends on this behaviour?

(2) Are there Linux file systems that don't work this way? Maybe
someone with a mounted writable reiserfs could do a quick check.

Please copy replies to me as I am not subscribed. Thanks.

Edmund
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

directory order of files

Post by Alan Co » Sat, 30 Jun 2001 18:40:12


Quote:> With Linux ext2, and some other systems, when you create files in a
> new directory, the file system remembers their order:

No - it merely seems too.

Quote:> $ touch one two three four
> $ ls -U
> one  two  three  four

Then try 'rm three; touch five'

Quote:

> (1) Is there any standard that says a system should behave this way?
> Is there any software that depends on this behaviour?

The order is arbitary.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

directory order of files

Post by Hans Reise » Sat, 30 Jun 2001 18:50:06



> With Linux ext2, and some other systems, when you create files in a
> new directory, the file system remembers their order:

> $ mkdir new
> $ cd new
> $ touch one two three four
> $ ls -U
> one  two  three  four

> (1) Is there any standard that says a system should behave this way?
> Is there any software that depends on this behaviour?

Unix filesystem hierarchies are defined to be a partial ordering, not a full ordering.

Quote:

> (2) Are there Linux file systems that don't work this way? Maybe
> someone with a mounted writable reiserfs could do a quick check.

> Please copy replies to me as I am not subscribed. Thanks.

bash-2.05# mkdir fu
bash-2.05# cd fu
bash-2.05# touch one two three four
bash-2.05# ls -U
one  two  four  three

Hans
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

directory order of files

Post by Alexander Vir » Sat, 30 Jun 2001 19:20:07



> > With Linux ext2, and some other systems, when you create files in a
> > new directory, the file system remembers their order:

> No - it merely seems too.

> > $ touch one two three four
> > $ ls -U
> > one  two  three  four

> Then try 'rm three; touch five'

Moreover, it isn't true even for the case when we create a list of files
in empty directory. Example: assuming that /tmp has 1Kb blocks,

mkdir /tmp/A
cd A
touch `perl -e 'print "a"x255'`
touch `perl -e 'print "b"x255'`
touch `perl -e 'print "c"x255'`
touch `perl -e 'print "d"x255'`
touch A
ls -U

will give you (lots of a) (lots of b) (lots of c) A (lots of d).

With 4Kb blocks you'll need 16 long names instead of 4 - the effect
will be the same.

The reason is quite simple - at some point you get no space for long
name and it goes into the next directory block, but there's still enough
for a short name, so it gets created in the first block.

IOW, there's no warranties at all.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

directory order of files

Post by lk » Sat, 30 Jun 2001 20:40:08


on reiserfs ls -U show soething like:

one two four three


> With Linux ext2, and some other systems, when you create files in a
> new directory, the file system remembers their order:

> $ mkdir new
> $ cd new
> $ touch one two three four
> $ ls -U
> one  two  three  four

> (1) Is there any standard that says a system should behave this way?
> Is there any software that depends on this behaviour?

> (2) Are there Linux file systems that don't work this way? Maybe
> someone with a mounted writable reiserfs could do a quick check.

> Please copy replies to me as I am not subscribed. Thanks.

> Edmund
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
 
 
 

1. specifing web file ordering before directory index


Hi,

I think, what you are looking for is this:

in your httpd.conf (somewhere int /etc or /usr/local/apache) you should
find something like

#
# DirectoryIndex: Name of the file or files to use as a pre-written HTML
# directory index.  Separate multiple entries with spaces.
#
<IfModule mod_dir.c>
    DirectoryIndex index.shtml index.html
</IfModule>

It tells apache, first to look for a file named 'index.shtml' and after
that 'index.html' when looking at a directory. If it doesn't find either
file it gives you just the directory-contents.

Hope it helps,
Wolfgang

Sent via Deja.com http://www.deja.com/
Before you buy.

2. Seagate's TapeStor 8GB SCSI DAT Tape Drive and Linux 1.2.39

3. Can I set order of files from directory listing?

4. Ethernet scanners

5. Directory Order

6. Trouble with glibc-2.1.1-5b

7. How does find(1) decide search order of directories?

8. Problem with network (switch. Suse)

9. Apache directory access order

10. propagating directory perms to new files in that directory

11. Script that recurses through all directories tries to check file/directory named "*"

12. Login Error -- getcwd: cannot access parent directories: No such file or directory

13. SEGV in NFS in deep directory (was: bash: looping over all files in directory)