APPEND to an existing file

Just starting out? Need help? Post your questions and find answers here.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Fangbeast.

Hey folks, using OpenFile(), it seems to recreate the file each time you write to it and I want to be able to append to an existing file,a dd headers etc.

Is there any way of doing this?

Regards, Fangly



Fangles
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by fred.

Hum, if it's confirmed, you have found a big bug :).

Fred - AlphaSND
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Fangbeast.

Hello Frede, I wasn't looking for bugs (Thought I had actually overlooked something as usual). But, I have been testing this for the better part of 4 hours and that is the behaviour, re-create.

In common with most BASIC variants that I have used over the last 18 years, who not have a flag as part of the OpenFile() command to set the mode and forget the ReadFile command??

As in (IsAlive = OpenFile(#1,Flag,FileName))

Flags 1 = Read Only, 2 = Read/Write, 3 = Read/Write&Append, 4 = Binary

Combining 2 & 4 would give Read/Write&Binary
Combining 2 & 3 would give Read/Write/Append&Binary

Or use the MODE command (as is most common with basics)

IsALive = OpenFile(#1, FileName) AS BINARY Etc etc

Fangles

Fangles
Post Reply