End ofFile Character

This forum is for eXpress++ general support.
Post Reply
Message
Author
omni
Posts: 534
Joined: Thu Jan 28, 2010 9:34 am

End ofFile Character

#1 Post by omni »

Roger,

We are sending a file to a web page that cannot have the end of file character (hex 1A).

We are using fwrite() and fclose(). Is there a way (method) to save this file without that character in Alaska, or any method to strip it off?

Fred Henck
Omni

Cliff Wiernik
Posts: 605
Joined: Thu Jan 28, 2010 9:11 pm
Location: Steven Point, Wisconsin USA
Contact:

Re: End ofFile Character

#2 Post by Cliff Wiernik »

I will have to check but I thought that memowrit() did this but the fxxxxx functions did not. Had came across this with the xml functions in express++.

Not completely certain without some testing.

Cliff.

omni
Posts: 534
Joined: Thu Jan 28, 2010 9:34 am

Re: End ofFile Character

#3 Post by omni »

Oh, I thought it was the other way around. Let me try the memowrite. I think I remember that also.

Thanks, Cliff

Fred

skiman
Posts: 1186
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: End ofFile Character

#4 Post by skiman »

Hi,

'memowrit' will add that character. Normally you wont have it when you use fwrite.

This is my function which i use for years.

Code: Select all


function abomemowrite(cTargetFile,cBuffer)
******************************************
Local nTarget := FCreate( cTargetFile, FC_NORMAL )
if nTarget == -1
    return .F.
  else
    FWrite( nTarget, cBuffer)
    FClose(ntarget)
endif 
return .T.
Best regards,

Chris.
www.aboservice.be

User avatar
rdonnay
Site Admin
Posts: 4733
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: End ofFile Character

#5 Post by rdonnay »

FWrite() does not add an EOF character.

I suspect that the EOF character is in the buffer text that you are writing.
The eXpress train is coming - and it has more cars.

omni
Posts: 534
Joined: Thu Jan 28, 2010 9:34 am

Re: End ofFile Character

#6 Post by omni »

Verified and memowrit, which is used for our log routine and other situations, just updates info in a file, and never has an eof character, at least not the way we do it.

We do a memoread, then write the memoread plus what is to be added. On our error logs, it never ends I think we got this straight from Rogers error routine years ago.

Fred

omni
Posts: 534
Joined: Thu Jan 28, 2010 9:34 am

Re: End ofFile Character

#7 Post by omni »

Sorry, I was wrong. The fwrite is the one that does not have the eof character.

skiman
Posts: 1186
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: End ofFile Character

#8 Post by skiman »

Hi,

That was what I thought.
It's the reason I made my abomemowrit() function once.
Best regards,

Chris.
www.aboservice.be

Post Reply