Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Open file help please

Author
Message
AramusM
20
Years of Service
User Offline
Joined: 6th Dec 2003
Location:
Posted: 3rd Feb 2004 00:25
Is there a way to append data to a file. OPEN TO WRITE wont work if a file exists and there doesnt seem to be an OPEN TO APPEND command. I want to create a continuous log file that i add to each time my program is run, but at the moment it seems if i want to do this i have to create a new file and copy the data from the old file to this and then add data to it. this will slow my program alot at the begining the more times i run my program. Ive had a quick look through the plugin's list and cant see any extened file access funtions. Can anyone help?
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 3rd Feb 2004 00:29
Have another look through the plug-ins list. TCA has an alternative to the built-in file I/O stuff

For free Plug-ins, source and the DBPro Interface library for Visual C++ 6 and .NET
http://www.matrix1.demon.co.uk
AramusM
20
Years of Service
User Offline
Joined: 6th Dec 2003
Location:
Posted: 3rd Feb 2004 00:52
ahh thanks. its the memory one. I looked at the first couple of lines of the description and it all looked like memory access functions. Hmm, looks a little more complex to use than the standard DBP functions, but then it looks stdio stuff from my c days. Not much in the way of tutorial on the way to use it:/ its a bit confusing as well, stdio's Fopen has 2 parameters filename and mode, where the fopen from the plugin has a third parameter that i can see has 4 modes, of which i can make out _SH_DENYRW(read/write) _SH_DENYRD(read) and _SH_DENYWR(write). but cant make out what _SH_DENYNO means and how to relate these to the fopen parameter if i want to open the file to append.
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 5th Feb 2004 13:03
Hi AramusM

Heres a small bit of code that I've done that lets you use the array command as append and delete and add to a file, ready saving and loading. you can find all these commands in small User Manual for DBPro on page32.

In Space No One can Hear You Scream! (When your comm Line is cut?)
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 5th Feb 2004 14:27
The only person that really knows what those constants mean is TCA. Just email him

For free Plug-ins, source and the DBPro Interface library for Visual C++ 6 and .NET
http://www.matrix1.demon.co.uk

Login to post a reply

Server time is: 2024-11-26 04:24:19
Your offset time is: 2024-11-26 04:24:19