realbasic-nug
[Top] [All Lists]

Re: Best way to handle loss of ResourceFork

To: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Subject: Re: Best way to handle loss of ResourceFork
From: Don Jungk <rb@flippingdades.com>
Date: Thu, 31 Jul 2008 10:11:00 -0500
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
Delivered-to: listarchive@realsoftware.com
In-reply-to: <p0600200cc4b777ca6932@[137.187.213.59]>
References: <mailman.3026.1217477886.19703.realbasic-nug@lists.realsoftware.com> <p0600200cc4b777ca6932@[137.187.213.59]>
Reply-to: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Sender: realbasic-nug-bounces@lists.realsoftware.com
User-agent: KMail/1.9.3
On Thursday July 31 2008 9:25 am, jda wrote:
>
> Without the resource fork, I can see only two solutions when I
> iterate over each of these files. One is to open each file, read in
> the data, determine if the function is enabled or not, close the
> file, and then set the listbox. This is clearly a poor solution with
> many hundreds of files to examine. The second solution I can think of
> is to assign a different extension to the files (e.g. .en for
> function enabled, .dis for function disabled, or some such thing),
> that my app can examine as it iterates over the file names to
> determine if the function is enabled or not. This also strikes me as
> kludgey and prone to cause problems.
>
> Basically I would like a way to determine a simple boolean setting of
> a file without having to open it and parse its contents. The
> ResourceFork was perfect for this. I'd appreciate any thoughts on the
> replacements I've come up with, or any I haven't considered.
>
> Jon
>

If you are creating these files and they are not going to be edited by users, 
then:
1) put something in the name of the file, like a "+" or "-".
2) pad the files to an even number of bytes for enabled and an odd number for 
disabled. Then you don't have to open them, just read the length. A change of 
encoding or line endings would mess this up.

DJ

_______________________________________________
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>