[Gllug] Linux equivalent of OS X filesystem Directory

C. Cooke ccooke-gllug at gkhs.net
Thu Nov 20 10:10:03 UTC 2008


On Thu, Nov 20, 2008 at 08:29:07AM +0000, t.clarke wrote:
> Is it still the case the directories are basically 'flat' files with entries
> inserted in the first available 'hole' and searches done linearly for
> specific entries? Since 'find' lists files in apparently random order that
> would seem to be the case....
> 

Depends entirely on the filesystem. ext3, for instance, can do this. It 
also uses a parallel [1] tree-based directory index [2], which is much
faster. Several other filesystems are entirely tree-based. 

[1]
Parallel in that ext3 will prefer the tree but fall back to the old
linked list method, which is always kept up to date. Thus, directories
in ext3 are actually *more* resilient than many other systems.

[2]
Turn on the 'dir_index' option on the filesystem and run e2fsck -D if 
this feature is disabled - it should be enabled by default on new
filesystems, though. 

-- 
X=80;Y=24;((Z=X*Y));O=(X+1 X X-1 1);a(){ for((p=0;p<Z;p++));do((y=p/X+1,x=p%X+\
1));q=${B[p]};z=0;[ $i ]||B[$p]=$(($RANDOM%3));for e in ${O[@]} ${O[@]//#/-};d\
o(((j=p-e)>0))&&((0${B[j]}>0))&&((z++));done;c=\ ;(($z==3))&&c=1;(($z==2))&&c=\
$q;echo -ne "\E[$y;${x}H$c";A[p]=$c;done;((i++));B=( "${A[@]}" );a;};a # ccooke
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list