Operating System - HP-UX
1834234 Members
2645 Online
110066 Solutions
New Discussion

identifying any invalid char in a file.

 
skt_skt
Honored Contributor

identifying any invalid char in a file.

1:-

adedd03n:root [/opt/local/unix/eracc/var/eracc] ll ediemerg
-rw------- 8 root sys 1 Dec 6 12:03 ediemerg
adedd03n:root [/opt/local/unix/eracc/var/eracc] cat ediemerg
kumarts
adedd03n:root [/opt/local/unix/eracc/var/eracc] od -cx ediemerg
0000000 6b75 6d61 7274 730a
k u m a r t s \n
0000010

2:-

adedd03n:root [/opt/local/unix/eracc/var/eracc] od -cx /opt/local/unix/eracc/var/eracc/ediemerg
0000000 6b75 6d61 7273 3130 0a00
k u m a r s 1 0 \n
0000011
adedd03n:root [/opt/local/unix/eracc/var/eracc] ll ediemerg
-rw------- 1 root sys 9 Dec 6 12:00 ediemerg
adedd03n:root [/opt/local/unix/eracc/var/eracc] od -cx /opt/local/unix/eracc/var/eracc/ediemerg
0000000 6b75 6d61 7273 3130 0a00
k u m a r s 1 0 \n
0000011
adedd03n:root [/opt/local/unix/eracc/var/eracc] cat /opt/local/unix/eracc/var/eracc/ediemerg
kumars10

I this scenario i am getting "invlaid control file format". It happens only to the use kumars10 and which have a 8 char while other working users have only 7 char user id, like kumarts.

so i am looking for any hidden enrties or some thing which i am not able to identify and which could cause an error reported

here is the binary i use to enable/disable the id.When enabled the control file (/opt/local/unix/eracc/var/eracc/ediemerg) occupies a particular user id and when disabled it become a blank line file with file size 1.

here is the binary i use to enable/disable the id.

adedd03n:root [/opt/local/unix/eracc/var/eracc] ll
total 2
-rw------- 1 root sys 1 Dec 6 12:03 ediemerg
adedd03n:root [/opt/local/unix/eracc/var/eracc] cat ediemerg



adedd03n:root [/opt/local/unix/eracc/bin] file eracc
eracc: PA-RISC1.1 shared executable dynamically linked
adedd03n:root [/opt/local/unix/eracc/bin] what eracc
eracc:

I am not sure if that binary is some thing which HP supports or provided by HP.

any suggetions would be appreciated.
5 REPLIES 5
Steven Schweda
Honored Contributor

Re: identifying any invalid char in a file.

I'm lost. What are you trying to do?

> i am getting "invlaid control file format".

From what? "eracc"? What is that?
A. Clay Stephenson
Acclaimed Contributor

Re: identifying any invalid char in a file.

eracc is not a standard command and "invalid control file format" only has meaning with respect to some application that reads this file. You better hunt up the documentation or contact the developer.
If it ain't broke, I can fix that.
F Verschuren
Esteemed Contributor

Re: identifying any invalid char in a file.

the od looks fine to me, I can not see anny strange behaver in the commands you have posted.

can you please try to explean the problem you are facing?

ps eracc is not standart hp. (as far I can findout)
skt_skt
Honored Contributor

Re: identifying any invalid char in a file.

yes it is not HP's tool.

I am in touch with the developer now to check the source code ..
skt_skt
Honored Contributor

Re: identifying any invalid char in a file.

it was a bug in the code in the c program.

Wrong:
/* read one line from control file */
fgets(readbuf,MAXLNLEN+1,fd);
fclose(fd);

Fixed:
/* read one line from control file */
fgets(readbuf,MAXLNLEN+2,fd);
fclose(fd);