LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-07-2004, 04:40 PM   #1
kfaday
LQ Newbie
 
Registered: Sep 2004
Location: argentina
Posts: 9

Rep: Reputation: 0
File indexing question


Hi
I’m going to develop an application for university and I would really appreciate some advice. I’m creating a file managing system, like tar, that creates a ‘file’ which manages a collection of files. You can add files to the ‘file’, create directories (a directory would be a file with pointers to inodes), delete them, etc. It’s like creating a small file system. I have to develop it in Linux, in C++, it’ll be an Object Oriented Program. I was thinking of dividing the ‘file’ in three parts, the main or first section, the ‘inodes’ section and the files section. The inodes are small pieces of data that contains information of the files inside the ‘file’, its name, where it starts and the size in bytes among other things. I was thinking that all of them could have the same size, but that’s not good, as space will be wasted for file names. Then, for indexing the files inside the big ‘file’, I was thinking in giving them numbers, and searching sequentially, but I need something more efficient. I heard that the best solution to that are trees. Which is the easier solution to implement, one which is also fast? Any other ideas of how could I index files inside the big ‘files’? Any links or recommended books on the subject? I’m quite new in this area of programming and I didn’t find anything useful on the net.

Thank you very much for your time!
 
Old 09-08-2004, 07:53 AM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
In fact, you're designing a simple filesystem, so things like description of Ext2 structure (or maybe even FAT) may be useful.

For me it's a good decision to use inodes. I'd also use trees (probably AVL or binary) to make searches faster.

You should think what to do with the filenames. Both fixed and dynamic space have advantages and disadvantages. Fixed: simplier, but not all space is used. Dynamic: only the space needed is used, but would you support an operation of renaming files (names getting longer and shorter)?

Would you also support directories? If yes, you can use a number of designs: every directory may be a tree, for example.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
File indexing - Best program to use? IMSargon Linux - Software 2 04-02-2006 02:59 PM
Beagle isn't indexing anything simeandrews Linux - Software 11 09-28-2005 05:02 AM
Folder indexing joey52 Linux - Newbie 2 02-18-2005 03:05 AM
LibPST -> just indexing? p41elvis Linux - Software 1 10-26-2004 06:55 AM
Appache indexing NewtonIX Linux - Software 7 08-21-2004 08:46 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:31 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration