Sorry about my vagueness, that code helps, but let me explain more, I'm totally lost as a noob. basically, there is 20,000 or so .yml files in the directory /home/gac3/plugins/Essentials/userdata/ these files contain a line labled login, that record the last login of a user, I need to take that timestamp, compare it to the current time, minus 5 days, so if the origin file has a user which has not logged in after 5 days, the .yml file is deleted. here is an example yml file.

timestamps: login: 1348876288937 logout: 1348876601161 lastteleport: 1348876478686 ipAddress: 192.168.1.1 lastlocation: world: Main_Flat2 x: -10.627933608068007 y: 38.9038268486379 z: -20.417177146511058 yaw: -192.60002 pitch: 24.150005 nickname: §lJack powertools: {} afk: false money: 0.0 homes: gf: world: Main_Flat x: -81.00634258469903 y: 50.0 z: 80.56448372272854 yaw: 238.24374 pitch: 78.49189

That line labled login, is what needs to be read, the script needs to read that line in every single file in the directory, all of which are the same format, and have that as a value which can then be compared. Any ideas ?


In reply to Re^4: Reading every file in a directory by spookyjack123
in thread Reading every file in a directory by spookyjack123

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.