Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #9451

Re: Representing a hierarchical file system

From Ian Collins <ian-news@hotmail.com>
Newsgroups comp.lang.c
Subject Re: Representing a hierarchical file system
Date 2011-08-16 08:32 +1200
Message-ID <9ate3oFgq5U3@mid.individual.net> (permalink)
References <j2as5n$4gl$1@speranza.aioe.org> <chine.bleu-2A8469.10350815082011@news.eternal-september.org> <j2bm0p$14f$3@speranza.aioe.org>

Show all headers | View raw


On 08/16/11 05:46 AM, jacob navia wrote:
> Le 15/08/11 19:35, China Blue Tip Wrench a écrit :
>> In article<j2as5n$4gl$1@speranza.aioe.org>, jacob navia<jacob@spamsink.net>
>> wrote:
>>
>>> typedef struct tagDirectory {
>>> 	char *Name;
>>> 	size_t NumberOfChildren;
>>> 	struct tagDirectory **Subdirs;
>>> 	size_t NumberOfFiles;
>>> 	file **Files;
>>> }Directory;
>>
>> Unix doesn't distinguish files and subdirectories in a directory. To get that
>> you need an additional call for each entry (stat). If you're going to stat, you
>> might want to save the information to avoid redundant stat calls. Also the
>> directory graph can be cyclic when you follow soft links.
>>
>
> I would rather ignore links, and avoid anything Unix specific (or DOS
> specific)
>
> Just a simple hierarchical representation with some attibutes like size
> and time
>
> I would like it to be as portable as possible

Your first and last statements appear contradictory; you can't ignore 
filesystem features and by portable!

I have an application that maintains a directory tree in memory (to 
enable us to search and index 30 million files).  I use is a file object 
and a directory object which is a file with an array of file pointers. 
Following the POSIX model, all meta-data is in the file object.

Because it doesn't care what a directory entry is, the POSIX interface 
is probably the most portable you will find.  Unix/Linux systems can 
access DOS and windows filesystems though the standard interface.

-- 
Ian Collins

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Representing a hierarchical file system jacob navia <jacob@spamsink.net> - 2011-08-15 12:24 +0200
  Re: Representing a hierarchical file system Ian Collins <ian-news@hotmail.com> - 2011-08-15 22:36 +1200
    Re: Representing a hierarchical file system jacob navia <jacob@spamsink.net> - 2011-08-15 19:43 +0200
  Re: Representing a hierarchical file system Keith Thompson <kst-u@mib.org> - 2011-08-15 09:23 -0700
    Re: Representing a hierarchical file system David Thompson <dave.thompson2@verizon.net> - 2011-08-21 03:22 -0400
  Re: Representing a hierarchical file system Nobody <nobody@nowhere.com> - 2011-08-15 18:02 +0100
    Re: Representing a hierarchical file system jacob navia <jacob@spamsink.net> - 2011-08-15 19:44 +0200
  Re: Representing a hierarchical file system China Blue Tip Wrench <chine.bleu@yahoo.com> - 2011-08-15 10:35 -0700
    Re: Representing a hierarchical file system jacob navia <jacob@spamsink.net> - 2011-08-15 19:46 +0200
      Re: Representing a hierarchical file system "Heinrich Wolf" <invalid@invalid.invalid> - 2011-08-15 20:31 +0200
      Re: Representing a hierarchical file system Ian Collins <ian-news@hotmail.com> - 2011-08-16 08:32 +1200
      Re: Representing a hierarchical file system Nobody <nobody@nowhere.com> - 2011-08-16 11:45 +0100
        Re: Representing a hierarchical file system BGB <cr88192@hotmail.com> - 2011-08-16 04:00 -0700

csiph-web