keeping files open 
Author Message
 keeping files open

Hi all.

Many apps (especially financial ones) seem to have a one or two
datafiles that are very often written to and/or read from, e.g. an
invoice file on a POS-system.

Does it make sense for the app opening and closing these files
repeatedly during runtime?

Or is there some problems involved in OPENing such a file at startup,
and only CLOSEing it just before the app closes down?

Just asking.....



Fri, 25 Jun 1999 03:00:00 GMT  
 keeping files open

Freddie,

It depends on your needs based upon your experiences.  There are arguments
in both camps.  

Some like the OPENing and CLOSEing of files for safety reasons, others do
not for speed reasons.  

If you have a file (or more than one - but not all) that should remain OPEN
all of the time, then you can override the open mode in th global settings,
while all the other "not so used" files can open and close as the use
demands.

I really do not have any hard and fast rules in this regard, but I know
that you can get a good balance of speed and safety.  You will have to
define what that "safety" is depending on how you see it.

BTW - Using the Topspeed driver is VERY safe and one of the fastest around.
--
Russell B. Eggen
Topspeed Corporation
Consulting Division

[Using MS Newserver]


Quote:
> Hi all.

> Many apps (especially financial ones) seem to have a one or two
> datafiles that are very often written to and/or read from, e.g. an
> invoice file on a POS-system.

> Does it make sense for the app opening and closing these files
> repeatedly during runtime?

> Or is there some problems involved in OPENing such a file at startup,
> and only CLOSEing it just before the app closes down?

> Just asking.....



Sat, 26 Jun 1999 03:00:00 GMT  
 keeping files open


-->Hi all.
-->
-->Many apps (especially financial ones) seem to have a one or two
-->datafiles that are very often written to and/or read from, e.g. an
-->invoice file on a POS-system.
-->
-->Does it make sense for the app opening and closing these files
-->repeatedly during runtime?
-->
-->Or is there some problems involved in OPENing such a file at startup,
-->and only CLOSEing it just before the app closes down?

If you really need to do that, you can do it very simply by declaring those files in your
MAIN procedure. This with tell the generator to generate code for checking and opening
files when you start your application, then close them when you close it.

It's the standard  way used by CW for one file when you use ODBC, so that you have only
one 'loggin'.

Bernard Grosperrin - ALIAS(Bernie) -Team Topspeed Internet



Sun, 27 Jun 1999 03:00:00 GMT  
 keeping files open

Quote:

>Many apps (especially financial ones) seem to have a one or two
>datafiles that are very often written to and/or read from, e.g. an
>invoice file on a POS-system.

>Does it make sense for the app opening and closing these files
>repeatedly during runtime?

Sure, but it's kind of up to you. Using CPD 2.1, I would always open all
files upon startup, and leave them open until the user exited the program.
Of course, these were DOS applications that did not share the computer with
other programs (you know, vertical application type stuff), and opening a
bunch of files every time you opened a browse really did take a few
seconds, so it was a no-brainer.

CPD data files are very robust, and leaving files was never a concern. I
used to like to show off by powering down a computer *while* it was writing
a complex transaction. Upon restarting the computer, the application would
rollback the transaction, and nothing would be lost other than the
transaction in question.

I'm sure the TOPSPEED driver is just as robust.



Sun, 27 Jun 1999 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Will "read [open foo.txt]" keep file open?

2. Files are kept open on NT

3. beginner question: keeping console window open

4. Keeping the parent form open

5. How to keep browse window open???

6. Cannot open a VI: it keeps prompting me to find the VI

7. How to keep stand-alone VIs on internet for open use

8. Keeping automation refs open

9. Parrot developers keeping an (Ruby)-open mind?

10. Keep socket connections open

11. How to keep the splash screen open until the application start

12. File Open, or not Open, question

 

 
Powered by phpBB® Forum Software