Legacy End of File Problems with 012 and 000

G

Greg Ennis

Everyone,

I am using perl to interface some mail receipts to a legacy system on
a SCO Unix system that is causing some problems.

The legacy system's grammer for text files requires the end of the
file be a null. 000 in octal. Many of the legacy text files end with
012 000 (Octal), some just end in 000. The description of text files
by this system stipulates that the end of file for text files is a
null.

The problem I am having is that a text file built and maintinted by
this system usually ends in 012 000. When I use perl to append to
this file, perl puts the data after the null so that it looks like 012
000 051 etc. I can read the file without difficulty using unix tools,
but the legacy system will stop the read at the null missing all of
the appended data.

I have been studying this problem for 2 days and have not been able to
figure out a perl solution. Is there a way for perl to start the
write process at the point of the null? and is there a way for perl to
add a null after the 012 so that every EOF is 012 000.

Would appreciate your suggestions and help.

Thanks,

Greg
 
G

Greg Ennis

Bob Walton said:
perldoc -f seek

print $fh "\x00";

Also check out

perldoc perlvar

particularly the variable $\ .
...
Bob,

Thanks much for your help. I still have not been able to make it work
like I need, but I need to read more about your suggestions. Thanks
again for the help!!!

Greg
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top