BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Re: File Open

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (IDE)
View previous topic :: View next topic  
Author Message
OBones
Guest





PostPosted: Sat Apr 17, 2004 2:17 am    Post subject: Re: File Open Reply with quote



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





PostPosted: Mon Apr 19, 2004 8:32 am    Post subject: Re: File Open Reply with quote



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 Smile
--
Andrue Cope
[Bicester UK]

Back to top
Mark Jacobs
Guest





PostPosted: Tue May 04, 2004 2:29 pm    Post subject: Re: File Open Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (IDE) All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.