 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
OBones Guest
|
Posted: Sat Apr 17, 2004 2:17 am Post subject: Re: File Open |
|
|
John W. Szuhay wrote:
| Quote: | I am using C++Builder v6 to develop a real-time app that needs to run once-a-minute day-in and day-out (24/7). Input to the app comes from a data file that is generated by another process every minute.
I am using fopen() and fclose() to open and close this file every minute but I have seen unreliable behaviour when the app has been running for days.
Is there a more robust way to repeatedly open files on Window platforms?
Borland supplies another function open() in its runtime library, is this better that fopen()? I am curious why Borland developed this function...
Also, are the C++ std lib file functions (i.e. ifstream, iostream) robust?
Thanks,
John
Try FileOpen and FileClose. |
|
|
| Back to top |
|
 |
Andrue Cope Guest
|
Posted: Mon Apr 19, 2004 8:32 am Post subject: Re: File Open |
|
|
On 16 Apr 2004 17:32:31 -0700, John W. Szuhay wrote:
| Quote: | Is there a more robust way to repeatedly open files on Window platforms?
|
That depends where the problem is but you could cut to the chase and use
CreateFile() and friends. That way any problems you encounter can be blamed
on the operating system
--
Andrue Cope
[Bicester UK]
|
|
| Back to top |
|
 |
Mark Jacobs Guest
|
Posted: Tue May 04, 2004 2:29 pm Post subject: Re: File Open |
|
|
We had similar problems with XP under Windows 2003 Server (small business), but we found a couple of problems.
1) Clients had a couple of entries in c:windowssystem32autoexec.nt which referred to Novell DOS support
TSRs. Commenting these out helped.
rem lh %SystemRoot%system32nw16
rem lh %SystemRoot%system32vwipxspx
2) We read that XP had some elaborate caching mechanisms that were causing problems with data integrity for
DataFlex databases and other ISAM flatfile systems. Their solution was to apply a couple of reg patches to
turn off these caching schemes, one for the server, and another for all attached clients.
------------------------------------------------------------
Client Registry patch (copy and paste into a .REG file if you like) :-
------------------------------------------------------------
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesVXDVREDIR]
"DiscardCacheOnOpen"=hex:01
------------------------------------------------------------
2003 Server patch (copy and paste into a .REG file if you like) :-
------------------------------------------------------------
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServiceslanmanserverparameters]
"EnableOpLockForceClose"=dword:00000001
"EnableOplocks"=dword:00000000
"CachedOpenLimit"=dword:00000000
"autodisconnect"=dword:ffffffff
------------------------------------------------------------
HTH. Having done everything above, our frequent fopens and fcloses are functioning as in the good old Windows
98SE days!
Mark Jacobs
DK Computing
http://www.dkcomputing.co.uk
[email]markj (AT) criticalremovethisspuriousantispamstuff (DOT) co.uk[/email]
"John W. Szuhay" <baysysex (AT) earthlink (DOT) net> wrote
| Quote: | I am using C++Builder v6 to develop a real-time app that needs to run once-a-minute day-in and day-out
(24/7). Input to the app comes from a data file that is generated by another process every minute.
I am using fopen() and fclose() to open and close this file every minute but I have seen unreliable
behaviour when the app has been running for days. |
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|