× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Mike wrote:
We are adding application security (to hide some fields) to an application
of mine. I want to use a subproceedure to check for authorization. The
problem is that I have never really grasped the concept to how to properly
handle file opening and reading. I have always taken the easy way out and
just opened and closed the file every time the subprocedure was called. Is
there a sample somewhere on how to do this properly?

'Properly' is in the eye... well, you know. What's wrong with the method you're using now? Are you seeing unacceptable performance, is it difficult to maintain... what's prompting you to want to change?

Addressing the question directly, opening the file is an easy decision; closing, not so easy. Some thoughts intended to stimulate thought and discussion:

Let RCLACTGRP or the appropriate API or *NEW activation group implicitly close your file. Call a 'cleanup' subprocedure that closes all your open files. Force the I/O directly to disk and just leave the file open. Thinking outside the normal I/O flow, stuff all your updates through a data queue or socket server that is connected to a NEP.

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.