realbasic-nug
[Top] [All Lists]

Re: File Suggestions?

To: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Subject: Re: File Suggestions?
From: "Peter K. Stys" <pkstys@gmail.com>
Date: Thu, 30 Apr 2009 15:45:05 -0600
Authentication-results: mx.google.com; spf=neutral (google.com: 74.124.194.228 is neither permitted nor denied by best guess record for domain of realbasic-nug-bounces@lists.realsoftware.com) smtp.mail=realbasic-nug-bounces@lists.realsoftware.com; dkim=neutral (body hash did not verify) header.i=@gmail.com
Delivered-to: listarchive@realsoftware.com
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=58smv+XnV7NDuGTRHYpy5wpLJbNEqyC8bhsKVNdwED0=; b=t8SDOVq+LiVN6Y2fx33TSaD8MwvPMA9m08uRHF0WhFfMxWqUVzcSFMi9LQw8R6Zkyn 6jZY2inkA4ET8BZ2GOICpRyUsMey7SJd2uJCnuifWmSBsJo8Xn9THmkSK+tZ/pJdM9YA t+YGRHy0v9OoisENCe1tIdIklP25Rst4iuGk0=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=MKYktkK/QQ7CNT8bPhdqo5NOs4ISlYXDjwh+tYJmfP/eIMZ24uv7/N3yhtr7MZYgww ENeIzV2ZDMXKl5Wkfqx3PWAG2ijverbvVtEsuV2hVED9scUSCAjGUZnxx1SEjnKIeFVL atKK9Sh0++HgAULnMeFo41qKQJewAZSBpjdPU=
In-reply-to: <6E706737-CC19-49C6-A92D-7F124CAF6F29@rbclass.com>
References: <6E706737-CC19-49C6-A92D-7F124CAF6F29@rbclass.com>
Reply-to: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Sender: realbasic-nug-bounces@lists.realsoftware.com
For my image analysis app, I converted to using the built-in SQLite
routines.  You create your tables, and then you can stuff whatever data
(binary, text, etc...) you want into your file, and the SQL engine takes
care of all the storage, indexing, updating.  I routinely have files up to
2GB in size, including z-compressed binary image data, metadata, etc, with
no problem.  Very easy, very convenient.One major caveat tho: I noticed,
only after the fact, that reading/writing to SQLite files on a remote volume
exacts a 20-fold performance hit (yes, 20x slower!).  The SQLite community
says that's life, nothing you can do.  So I had to create a workaround
whereby I read a remote file to a temporary local file on the local drive,
then R/W to it, then copy it via afp back to its remote location.  A royal
pain to setup, but it works.

As for virtual volumes, it greatly depends on your image sizes.  For mine,
which routinely run in excess of 100 MB, VV's perform 100x slower than flat
single binary files (I can send you a test project that shows this).  So for
me, it was not feasible.

Unless you have a single large binary blob you need to R/W en bloc, I'd
recommend using SQLite, with the noted caveat.
P.


On Tue, Apr 28, 2009 at 12:30 PM, Mark O'Neill <real@rbclass.com> wrote:

> Hi All,
>
> Before I go ahead and code some binary version of my XML-based document
> file I'd just like to ask if there's a right and wrong way to save and read
> a binary file for this purpose having never really used binary files before.
>
> Background:
>
> Basically my app currently reads and writes all of its data in xml format.
> It is for the main purely text but also contains images which are stored in
> the xml as file references by EncodeBase64. (I initially stored the pictures
> to the xml file with Norman's pictureToString routine but a saved file would
> grow so large that it wasn't practical.)
>
> But now I need to add more images to the file and (more importantly) make
> the file portable, in which case file references just won't do and so I'm f
> going down the binary file route.
>
> So my question is - what's the best approach to storing different kinds of
> text and images in one binary file for use as a document file by my app? Any
> pitfalls/ schoolboy errors to watch out for?
>
> Thanks for your help.
>
> All the best,
>
> Mark.
> ------------------------------------------------------------
> RB Class
> "Killer Tool Bar" - theme-based x-platform toolbar
> www.rbclass.com
>
>
>
>
>
>
>
> _______________________________________________
> Unsubscribe or switch delivery mode:
> <http://www.realsoftware.com/support/listmanager/>
>
> Search the archives:
> <http://support.realsoftware.com/listarchives/lists.html>
>



-- 
---------------------------------------------
Peter K. Stys, MD
Dept. of Clinical Neurosciences
Hotchkiss Brain Institute
University of Calgary
tel (403) 210-8646
---------------------------------------------
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>