Greetings monks:
The following is an xmms hack that logs the track listened to and its time played. Interestingly enough it created time annomolies! Any monks that have the time to spend
with the following code would help this intrepid coder on his way through a journey of time.
First to impliment the script tracktime, edit the command parameter in the Song_Change1.2.4(libsong_change.so)
{this plugin is enabled in the previos dialouge}
to include:
echo %s >>/opt/www/musicpub/tracks |perl /home/japh/bin/tracktime
These are accessed via OPTIONS,PREFERENCES,EFFECTS/GENERAL PLUGINS
ii)The code for tracktime:
my $tracks;
my $ritetime;
my $philetracks;
opendir(MUSICPUB, "/opt/www/musicpub/");
while (defined($tracks=readdir(MUSICPUB)){
if ($tracks=~m/tracks/){
$philetracks="/opt/www/musicpub/$tracks";
}
}
closedir(MUSICPUB);
$ritetime=(stat($philetracks))[9];
open(TRACKS, "+<< /opt/www/musicpub/tracks");
print TRACKS "$ritetime\n";
close TRACKS
This code produced the following output upon initial testing:
311-Evolution:
1093970368
311-Freak Out:
1093970368
311-FullRide:
1093970368
311-Champagne:
1093970739
311-Hive:
1093970368
Thanks for any insight into this temporal predicament.
# I'm posting my progress with the tracktime script
in question. It would seem as a miscrient file
created by early testing (the file was named tracks0)
was somehow being matched by the first regular expression!?
So, removing tracks0 from the target directory magically
fisked the problem.The tracktime reported is in ascending order so futher manipulations of the difference and conversion functions can be added.Thanks for the help,
as far as the regex is concerned possible explanations would
be welcome.
Now , back to thinking about Gauss and the number 5050....
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.