here's the point, as the help from TC says:
"On text files, when write sees LF (linefeed) character, it outputs a CR/LF (carriage-return/linefeed)pair"
and here is a little example from my code:
Code:
i=0;
do
{
read(fd,&c,1);
if(c!='\n' || !eof(fd))
{
x.telefono[i]=c;
i++;
}
}while(c!='\n' && !eof(fd));
x.telefono[i]='\0';
if(strcmp(x.nombre,nom)!=0)
{
int fd2=open("temp.txt",4);
if(fd2<0)
fd2=creat("temp.txt",751);
else
{
lseek(fd2,0,2);
write(fd2,"\n",1);
}
write(fd2,&x.nombre,strlen(x.nombre));
write(fd2,"|",1);
write(fd2,&x.direccion,strlen(x.direccion));
write(fd2,"|",1);
write(fd2,&x.telefono,strlen(x.telefono));
close(fd2);
}
so my problem is this:
In the last part (x.telefono), i dont want that the function write automatically put the CR character on my file, so anyone have an idea??