Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re: Confusing Use of Time

by chromatic (Archbishop)
on Aug 31, 2004 at 22:27 UTC ( [id://387347]=note: print w/replies, xml ) Need Help??

in reply to Confusing Use of Time

According to perldoc -f stat, the entry at index 9 of the return value is the last modified time of the file in the number of seconds since the epoch, if your filesystem supports that information.

What time information did you expect? Did you perhaps want index 8, the last accessed time? Even then, I'm not sure that the filesystem stores any information about how long XMMS played a particular file.

Replies are listed 'Best First'.
Re^2: Confusing Use of Time
by dReKurCe (Scribe) on Aug 31, 2004 at 23:26 UTC
    Thanks for the reply. The time reported is indeed the number of seconds since the epoch(i'm thinksing now about the IEEE and the cookbook quote;) Perhaps I was accordingly mistaken in thinking that time flows forward: ie;the writen track title echoed to the tracks file toggles the mtime at song changes,so the two time indices are the ending of one song to the begging of the other.
      You are mistaken. The mtime is the time when the file was last modified. For a music track, this is likely when the file was created or copied. xmms should not be modifying the files when it reads them.

      You should try looking at the access time (index 8 in stat array). It will be changed by xmms reading from the file. You might be able to make the assumption between the atime on the previous file and atime on current file is the play time for the current file. But you will have to verify this. It will depend on when xmms calls the plugin.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://387347]
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2024-05-26 18:54 GMT
Find Nodes?
    Voting Booth?

    No recent polls found