its interesting how many different ways the same thing can be implemented 
.. I started with tail -f child process, switched to watch file+readStream 
option and so now what you are suggesting seems like another option .. so 
is this the idea

use fs.open to start reading the file and then use a callback function to 
check any added bytes and read those using fs.read

so the advantage here is that the file stays opened or something ??

also to clarify in my application i am providing a list of log files only 
the latest one is the one that keeps getting udpated and user can open up 
older files as well which dont change

On Wednesday, July 4, 2012 3:20:49 PM UTC-5, hasanyasin wrote:
>
> Hey Adeel,
>
> Did you take a look at the code example I gave? You do not need to use 
> watch if your process is running and the file is being written constantly. 
> For exact implementation of tail -f completely in Node, please take a look 
> at the working code I had given the address for.
>
> On Wed, Jul 4, 2012 at 4:09 PM, Adeel Qureshi <[email protected]>wrote:
>
>> so i have changed my tail implementation to use watchFile and 
>> createReadStream combination instead of tail -f child process and it seems 
>> to be working pretty good .. even though in this case I am opening up the 
>> file read stream every time there is a change in the file .. i m just 
>> curious how is that supposed to be more efficient than the tail process .. 
>>  
>> i havent tried the fs-ext option yet
>>
>>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to