realbasic-nug
[Top] [All Lists]

Best way to handle loss of ResourceFork

To: realbasic-nug@lists.realsoftware.com
Subject: Best way to handle loss of ResourceFork
From: jda <jda@his.com>
Date: Thu, 31 Jul 2008 10:25:54 -0400
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: <mailman.3026.1217477886.19703.realbasic-nug@lists.realsoftware.com>
References: <mailman.3026.1217477886.19703.realbasic-nug@lists.realsoftware.com>
Reply-to: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Sender: realbasic-nug-bounces@lists.realsoftware.com
ResourceFork is deprecated and scheduled for oblivion, so I'm looking for another solution to handle the following situation (on a Mac, of course)

I have a series of ancillary text files whose names my app displays to the user in a listbox. These files contain connection information that my app uses to access different Internet sites. There is one function (it doesn't matter what) that can be enabled or disabled, and I want the user to see that in the listbox display.

My solution has been to add a resource of my own making to each file that contains text, either "true" or "false". If "true", the name of the file is displayed in italics in the listbox. If "false" it is displayed in plain text. So all I need do is check the resource of each file (there may be many hundreds of them) and then set the text style of the listbox cell accordingly.

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

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