Actually the embedded device is a small self containing linux server, see
www.acmesystems.it
The device has an USB harddrive attached to it and the drive is shared via
samba, which is way i
add or remove mp3 songs.

The device would serve as my home server and i would access it via BT either
from my palm or a phone,
so there will never be a pc connected to it other when i transfer new songs
to it.

The synch process would be manually started by the user (me)

//John






On 2/19/07, andrew clarke <[EMAIL PROTECTED]> wrote:

  On Sun, Feb 18, 2007 at 08:39:45PM +0100, John Gunnarsson wrote:

> This is the case, the application is developed in c++ under linux, and
> is going to be cross-compiled to an embedded linux device, so memory
> usage and speed is important.

It sounds like you're essentially writing a program to sync files
between a PC and a removable disk [which happens to double as an MP3
player]. I would be surprised if there were no tools to do that
already.

I'm a little bit perplexed as to why you'd want to run the program on
the device itself. Perhaps you want to sync two embedded devices to
each other. But then what happens if you later connect the devices to
their "base" PC?

> The application should index a large amount of files (mp3's) and
> extract some information about it and store the fileinfo + songinfo in
> a sqlite db, so I can query the database later in a GUI.

I would write some simple non-GUI programs to do some tests first. You
can even hack together some quick prototypes in Python, which has very
good support for SQLite.

> Files are stored on a hdd so they could be removed, or new one could
> be added. I need to update the sqlitedb when files has been
> remove/added.
>
> To accomplish this I have thought up some ways to do it, one of them I
> describe below.
>
>
> When i enumerate the files, for each file i query the db if it already
> exists, if not I add the file to the db. If it existed in the db i add
> it to a internal list (hashlist). When all files in the filesystem are
> processed, I query the database for all filenames and check each and
> every one againt the internal list, if it does not exist the file is
> detected as deleted, and removed from the db.
>
> Cons: could be slow, one db-query for each file in the filesystem, the
> internal list could be memory consuming.

It is a bit difficult to answer without any knowledge of the limitations
of the embedded device you want to use. For example, I have a HP iPaq
phone/PDA with no moving parts, and it sounds like it would be easily
capable of quickly running your program. It is an embedded device, with
a CPU speed of 400 MHz, 64 (or 128?) Mb of internal flash memory, 64 Mb
of RAM and a slot for removable external flash memory cards.

Also, consider that file syncronisation should not necessarily need to
happen instantaneously. If it takes 10 seconds to work, the user may
still be happy!

Regards
Andrew

Reply via email to