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