curl-users
Re: reading a log file while open
Date: Fri, 22 Apr 2016 09:30:13 -0400
> On Fri, 22 Apr 2016, Francisco Gonzalez Velasco wrote:
>
> C:\>curl -o c:\q\events.txt -k -H "Authorization: Bearer My_Authorization" "
> https://stream-fxpractice.oanda.com/v1/events"
>
> I need to read the contents of the events.txt file while the cURL process is
> still active.
>
> Is this possible?
Just yesterday I read about a Windows-centric "tail" functionality.
Maybe it will work.
PowerShell has some features which might do the job, may or may not be
documented or available in certain versions, or may not work right at
all. But it may be worth exploring.
Get-Content output.log -Wait | where { $_ -match “regexp” }
Get-Content -Path C:\fso\output.log -Tail 1 –Wait
Otherwise, Google "tail on windows", and find a Windows port of tail, or
some other utility. Some other unix magic, used to involve a program
"tee". Oh, a quick search, PowerShell has something like that now too.
This may have the advantage of bypassing Windows silly "lock all fopen
writes unless you use our specific non-standard fopen" behavior.
https://en.wikipedia.org/wiki/Tee_%28command%29
-- Leif ------------------------------------------------------------------- List admin: https://cool.haxx.se/list/listinfo/curl-users FAQ: https://curl.haxx.se/docs/faq.html Etiquette: https://curl.haxx.se/mail/etiquette.htmlReceived on 2016-04-22