Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to store a directory info into a database?
>>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 handledirectories)
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