[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
[an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]![]() |
![]() |
![]() |
|||||||||||||||||||||||||
|
|||||||||||||||||||||||||||
![]() |
![]() |
![]() |
Hej jag löste problemet, men inte på det viset som jag ville. Så här gjorde jag. Först sätter jag pipen till blockerande om det inte finns någon data att läsa. temp=fcntl(fd_read, F_GETFL,0); if(temp==-1) out("Error fcntl fd *** %s\n", strerror(errno)); if(temp!=-1){ temp &= ~O_NDELAY; if(fcntl(fd_read, F_SETFL, temp)==-1) out("Error fcntl fd *** %s\n",strerror(errno)); } Sedan skrev jag en funktion som läser in tills den hittar terminerings tecknet. I övrigt så fungerar den som read. int Read(int fd, char *buf, int count, char term) { int counter=0; char c; do{ read(fd, &c, 1); buf[counter] = c; counter++; } while(c != term && counter < count); if(counter != count) buf[counter] = 0; return counter; } Resultatet blir samma som jag ville komma åt. mvh Martin Bertilsson Haagen
![]() |
![]() |
![]() |
||||||||||||
|
||||||||||||||
![]() | ||||||||||||||
|
||||||||||||||
![]() |
![]() |
![]() |