On Wed, 12 Jan 2005 Swapnil Nagle wrote :
>> i am writing a program which willcopy all the lines from system log file /var/log/messages and put it in a user log file
>>i am using syslog with syscall3 but when i am using write system cal it is not able to write anything
>
>fd = open(/var/log/messages)
>fd1 = open(myfile)
>
>read(fd, buffer,count)
>write(fd, buffer, count)
>
>Why do you need syslog, syscall3 etc. ?
sir as i thought there will be a deamon programwhich will access the logfile and extract the usefule messages into my file so as the file is being access by the kernel so i have to switch the mode in order to access it
therefore i was thinking of using syslog
the piece of code you have provided is not working as it is issueing read error while opening the4 /var/log/messages file
sounak
>
>--Swapnil
>
>"Theory is when you know something, but it doesn't work.Practice is when something works, but you don't know why.Programmers combine theory and practice: Nothing works and they don't know why ..."