*BSD News Article 24689


Return to BSD News archive

Newsgroups: comp.unix.bsd
Path: sserve!newshost.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!sgiblab!swrinde!cs.utexas.edu!howland.reston.ans.net!pipex!sunic!uts!dmicvx2!ls
From: ls@dmi.min.dk (Lennart Sorth)
Subject: Q: howto  select() on diskfile ?
Message-ID: <CHHFGJ.F23@dmi.min.dk>
Organization: DMI, Danish Meteorological Institute
Date: Fri, 3 Dec 1993 23:19:31 GMT
Lines: 18

Having done  select() on sockets and FIFO's I was pretty
sure the same method would do when waiting for a file to
be sequentally appended to    (a la 'tail  -f' )

My program *works* :-)  but the select()  does *NOT* wait for 
data to be ready, - rather just polling, and looping and
thereby consuming all the CPU it can get. :-(

Can select() not be used for real disk-files - and why not ?


Thanx
--
| Lennart Sorth  , D.M.I    /                                       |
| Lyngbyvej 100            /      You can do anything with perl...  |
| Tlf: 39 15 75 00, x546  /       except read it !                  |
| e-mail: ls@dmi.min.dk  /                          -many           |
`-------------------------------------------------------------------'