Restored from previous forum. Originally posted by fweil.
I need to append information to a file, ie: add a line at the end of the file to manage something like a log file.
I do not find the possibility to do this without reading the whole file in PureBasic. Maybe I am wrong ?
Does one have experienced this kind of feature with PB or does it exist something using Win API ?
Otherwise I will post this later as a feature request !
Francois Weil
14, rue Douer
F64100 Bayonne
File append
-
BackupUser
- PureBasic Guru

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

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

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

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by PB.
> I need to append information to a file, ie: add a line at the end of the file
> to manage something like a log file.
Here's an "AddLine" procedure that I posted last year. The good thing about it
is that you don't need to Open/Close any files to accomplish the deed, ie. you
just call the procedure like this: AddLine(filename$,line$).
viewtopic.php?t=336
PB - Registered PureBasic Coder
Edited by - PB on 28 June 2002 20:02:40
> I need to append information to a file, ie: add a line at the end of the file
> to manage something like a log file.
Here's an "AddLine" procedure that I posted last year. The good thing about it
is that you don't need to Open/Close any files to accomplish the deed, ie. you
just call the procedure like this: AddLine(filename$,line$).
viewtopic.php?t=336
PB - Registered PureBasic Coder
Edited by - PB on 28 June 2002 20:02:40
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by fweil.
I checked Fred response and PB snippet, and my conclusion is that fileseek allows to have an close-to-non-filesize-dependent response time !
This was my concern to have logfiles processing with the possibility to let logfiles growing to a large size (ie : several MB) with a short time to process each log add.
I measured it on my PC and found reasonable results even on > 32MB file size (< half a ms each log for this test with the file growing from 0 to 32MB).
It sounds good to me.
Thnx2all
Francois Weil
14, rue Douer
F64100 Bayonne
I checked Fred response and PB snippet, and my conclusion is that fileseek allows to have an close-to-non-filesize-dependent response time !
This was my concern to have logfiles processing with the possibility to let logfiles growing to a large size (ie : several MB) with a short time to process each log add.
I measured it on my PC and found reasonable results even on > 32MB file size (< half a ms each log for this test with the file growing from 0 to 32MB).
It sounds good to me.
Thnx2all
Francois Weil
14, rue Douer
F64100 Bayonne