Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: How to store a directory info into a database?

Re: How to store a directory info into a database?

From: M. Tschursch <bert_at_tsa.de>
Date: Mon, 10 Jun 2002 16:48:21 +0200
Message-ID: <3D04BC35.3010601@tsa.de>


>>Thanks for your kind suggestions. But my immediate thought was that it
>>would be very difficult the program interfacing to the database as the
>>schema is not fixed, it changs dynamically.

Ok .... a fixed schema is like this:
table file {

	id unsigned int(6) primary key not null,
	filetype int(2) not null,
	name varchar not null,
	parent_id int

}

this is just for basic info, just add attributes if u need more (i.e. filesize, owner )

filetype is just

   1 == directory
   2 == filename
(u can expand this too, i.e. 3 == symbolic link ... name contains linked   file.id )

PROS:

- all files and dirs go into one table
- u can store as many level as u need / want
- changing structure is quite easy ( just one table )
- a directory is just a special file (like all filesystems handle 
directories)

CONS:
- huge content , need indexes
- joins / search may be slower

perhaps u split this into a file, directory table ... but i wouldnt suggest so Received on Mon Jun 10 2002 - 09:48:21 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US