Code Comments
Programming Forum and web based access to our favorite programming groups.Hello, when exporting data with copy to the file gets a hex 1a byte appended. Is it possible to create a sdf file without his byte added ? Thanks Andreas
Post Follow-up to this messageAndreas > when exporting data with copy to the file gets a hex 1a byte appended. > Is it possible to create a sdf file without his byte added ? After creating the file, open it, move to the end byte - 1, write a byte, cl ose the file. Eg nHandle := FOpen( 'sdffile.txt', FO_READWRITE + FO_EXCLUSIVE ) FS( nHandle, -1, FS_END ) FWrite( nHandle, CHR(32), 1 ) FClose( nHandle ) -- HTH Steve Quinn
Post Follow-up to this messageStephen Quinn schrieb: > Andreas > > > > > After creating the file, open it, move to the end byte - 1, write a byte, close the file. > Eg > nHandle := FOpen( 'sdffile.txt', FO_READWRITE + FO_EXCLUSIVE ) > FS( nHandle, -1, FS_END ) > FWrite( nHandle, CHR(32), 1 ) > FClose( nHandle ) > > -- > HTH > Steve Quinn > > hello Steve, this does not truncate the file, but in our case it seems it works. Thanks Andreas
Post Follow-up to this messageAndreas Moroder wrote: > Hello, > > when exporting data with copy to the file gets a hex 1a byte appended. > > Is it possible to create a sdf file without his byte added ? > Why is it a problem? The 0x1a is chr(26) otherwise Cntrl-Z, the old CP/M and MSDOS end-of-file indicator. It is invisible in normal contexts. Why do you want to 'get rid' of it? If you concatenate two sdf files, the ^Z at the end of the first one disappears and is replaced by the first byte of the second file. You may very well have a problem. I'm just curious what it is. -- Joe Wright mailto:joewwright@comcast.net "Everything should be made as simple as possible, but not simpler." --- Albert Einstein ---
Post Follow-up to this messageAndreas > this does not truncate the file, but in our case it seems it works. Well it's to overwrite the CHR(26) (Ctrl+Z/EOF) with CHR(32) (SPACE) If you want to truncate it then you'll need to copy the file all bar the las t character. If you have Funck(y), it has a Truncate() function. -- HTH Steve Quinn
Post Follow-up to this messageIn article <c2s4j7$ift$1@news.flashnet.it> amoroder@sb-brixen[nospam].it "Andreas Moroder" writes: > Stephen Quinn schrieb: > > close the file. > hello Steve, > > this does not truncate the file, but in our case it seems it works. In order to truncate the file you must write zero bytes to it -- just change to: FWrite( nHandle, "" ) and that ^Z will disappear... Pete -- "We have not inherited the earth from our ancestors, we have borrowed it from our descendants."
Post Follow-up to this messageJoe Wright schrieb: > Andreas Moroder wrote: > > Why is it a problem? The 0x1a is chr(26) otherwise Cntrl-Z, the old CP/M > and MSDOS end-of-file indicator. It is invisible in normal contexts. Why > do you want to 'get rid' of it? If you concatenate two sdf files, the ^Z > at the end of the first one disappears and is replaced by the first byte > of the second file. > > You may very well have a problem. I'm just curious what it is. Because the web application i load the data into does not like this char. Bye Andreas
Post Follow-up to this message* Stephen Quinn <steveqNOSPAM@integritynet.com.au>: > If you want to truncate it then you'll need to copy the file all bar the > last character. If you have Funck(y), it has a Truncate() function. Or you can FSEEK() to the location you want to truncate from and then do a: ,---- | fwrite( hFile, "", 0 ) `---- -- Dave Pearson | OSLib - Timeslice release functions. http://www.davep.org/ | eg - Norton Guide reader for Linux . http://www.davep.org/clipper/ | weg - Norton Guide reader for Windo ws. http://www.davep.org/norton-guides/ | dgscan - DGROUP scanner for Clipper.
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.