Hi all, this is not a GPC-specific question, but here it goes anyway... :-)
I need a data structure or object in Pascal that basically can hold a file-system. Only difference between this and an ordinary filesystem is that permissions, timetags, etc, are not needed, "only" the directories and filenames as well as ~10-20 bytes storage for each file.
Any idea how this could be accomplished, or pointers to already existing source?
Best regards
Preben Bohn
===== Computers are like airconditioners: They stop working properly if you open windows.
__________________________________________________ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com
On 21 Jun 2002 at 12:36, Preben Mikael Bohn wrote:
Hi all, this is not a GPC-specific question, but here it goes anyway... :-)
I need a data structure or object in Pascal that basically can hold a file-system. Only difference between this and an ordinary filesystem is that permissions, timetags, etc, are not needed, "only" the directories and filenames as well as ~10-20 bytes storage for each file.
Any idea how this could be accomplished, or pointers to already existing source?
I am not sure what precisely you want to use this for - but the simplest solution that I can think of is to use some sort of container for your files (e.g., a zip archive).
Best regards, The Chief --------- Prof. Abimbola Olowofoyeku (The African Chief) Email: African_Chief@bigfoot.com http://www.bigfoot.com/~african_chief/
--- "Prof. A Olowofoyeku (The African Chief)" african_chief@bigfoot.com wrote:
I am not sure what precisely you want to use this for - but the simplest solution that I can think of is to use some sort of container for your files (e.g., a zip archive).
I need it for making a database of all my files (~100000) with some additional information in it (such as e.g. timetags, backup time, etc). Of course I could just use a copy of the file-system to another directory, but this is to slow (too many system-calls every time you need to create a file, etc) and it takes up too much space (I only need <20 bytes of data per file).
So the two main requirements to it is that is should be fast to look up files, and it shouldn't take up too much space.
I was thinking about maybe making a small FAT-look-alike-system...
Best regards
Preben Bohn
===== Computers are like airconditioners: They stop working properly if you open windows.
__________________________________________________ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com
Preben Mikael Bohn wrote:
I need it for making a database of all my files (~100000) with some additional information in it (such as e.g. timetags, backup time, etc). Of course I could just use a copy of the file-system to another directory, but this is to slow (too many system-calls every time you need to create a file, etc) and it takes up too much space (I only need <20 bytes of data per file).
So the two main requirements to it is that is should be fast to look up files, and it shouldn't take up too much space.
I was thinking about maybe making a small FAT-look-alike-system...
Since this looks like some serious amount of data, you might want to think about using, e.g., a SQL database such as MySQL (that's the one I use; I can't compare it with other databases, but it works well for me). Besides doing the data management efficiently, it will also allow for complex query operations. (Sure, you'd have to learn SQL syntax if you don't know it already, but it's not that complicated.)
Eike Lange wrote a MySQL unit, I wrote a Database unit which uses MySQL and provides access to the most common operations with a slightly more comfortable (at least to me ;-) interface. You can find them in our respective contrib directories.
BTW, MySQL is a client/server database, so it probably won't work under plain Dos for lack of multitasking (unless you put the server on a separate box), but on Unix and Windows, it should be no problem.
Frank