Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

cog (4665)

Journal of cog (4665)

Friday September 03, 2004
05:34 AM

Appending to a file

[ #20708 ]
Not necessarily with Perl, though...

My current problem is: when redirecting output to a file, the file is apparently written only by the end of the process... I can't track its progress with something such as tail! :-|

I tried using tee, Perl, etc... it seems of no avail...

My purpose is a simple one:

mplayer *.mp3 -shuffle | grep Playing >> .now_playing

You can easily tell where this is going... I want to be able to see the music now playing by looking at the last line in the file :-)

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • use IO::File;
    $now = IO::File->new(">>.now");
    open( MP , "mplayer *.mp3 -shuffle 2>/dev/null |");

            print NOW $_;
  • If you wanted to use mpg123, and were willing to live with overkill, you could use this, with a bit of file IO added. I only mention it because it's only two days old and still in my head...