Thanks in advance,
----------------------------------------------------------------------------
---------------------------------------------
Su Duy Trinh
Email : [EMAIL PROTECTED]
[EMAIL PROTECTED]
Website : www.terminalc.com
Phone : 08-8421867 , 08-8119599
----- Original Message -----
From: Max Bian <[EMAIL PROTECTED]>
To: Palm Developer Forum <[EMAIL PROTECTED]>
Sent: Monday, January 07, 2002 2:08 PM
Subject: Re: Questions about database
>
> --- Jeremy Neal Kelly <[EMAIL PROTECTED]> wrote:
> > > The database has to be sorted to have a better performance. The
sorting
> > is a
> > > big pain.
> >
> > Is sorting so difficult? I think it depends on the context.
>
> In my case, the task is to sort items (directory or file) in a directory
tree.
> I have to make sure:
>
> 1. All the items in a directory should be placed right after that
directory in
> the database.
> 2. The items in the same directory need to be sorted by name, size, date,
etc.
> 3. When comparing dir and file in the same parent directory, the directory
is
> always larger.
>
> For exmaple, "file1" and "file2" are in two different files like this:
>
> "/doc/stuff/file2" and "/tmp/trash/old/file1". How to compare these?
>
> "file1" and "file2" cannot be compared directly. It has to be compared at
> root! In this case, if I want to sort by name, I have to compare "doc" and
> "tmp".
>
> This is the most weird thing I have done. It does work quite nicely. If
I
> want to retrieve a directory and all item in that directory, all I have to
do
> is to find the first one by searching through the database, then increment
the
> index one by one to get all the rest.
>
> There are maybe better solutions for this. For example, the way a real
file
> system is implemented. FAT, EXT2, NTFS...
>
> So, to get what SU want. It is possible to allocate a chunk in the
database,
> store the linklist in that chunk.
I think so.However,my problem is the following:first item in linked
list(a record in database) has other items in the linked list(and like other
records in the database) must save for them,we use a other database with
fisrt database?If we use the method,linked list in
second,third,...record,How do we do for the linked lists?
Thanks,
Trinh
By doing so, there is no need to worry about
> the sorting.
>
> Max
>
> =====
> -=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-
> Got Palm?
> Get ExBox at http://www.weirdwww.com/ExBox to beam anything!
>
> __________________________________________________
> Do You Yahoo!?
> Send FREE video emails in Yahoo! Mail!
> http://promo.yahoo.com/videomail/
>
> --
> For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/tech/support/forums/
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/