[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]



> -----Original Message-----
&gt; From: ale-bounces at ale.org [<a  rel="nofollow" href="mailto:ale-bounces";>mailto:ale-bounces</a> at ale.org] On 
&gt; Behalf Of Fletch
&gt; Sent: Tuesday, November 23, 2004 6:10 PM
&gt; To: Atlanta Linux Enthusiasts
&gt; Subject: Re: [ale] Quick Perl Q
&gt; 
&gt; 
&gt; I'd use link() (or symlink) rather than copy() unless you 
&gt; really want a duplicate file to muck with, but that's just me.
&gt; 
&gt; lemur:/tmp/foo 724&gt; l
&gt; total 0
&gt; -rw-r--r--  1 fletch  wheel  0 23 Nov 17:53 abc.EMB
&gt; -rw-r--r--  1 fletch  wheel  0 15 Nov 12:34 def.EMB 
&gt; lemur:/tmp/foo 725&gt; perl -MPOSIX=strftime -le 
&gt; 'for(&lt;*.EMB&gt;){m{(.*?)\.EMB$};unless($m=(stat$_)[9]){warn&quot;canno
&gt; t stat $_: 
&gt; $!\n&quot;;next}link($_,strftime(&quot;$1-%Y%m%dT%H%M%S.EMB&quot;,localtime$m
&gt; ))||warn&quot;cannot link $_: $!\n&quot;}'
&gt; lemur:/tmp/foo 726&gt; l
&gt; total 0
&gt; -rw-r--r--  2 fletch  wheel  0 23 Nov 17:53 abc-20041123T175315.EMB
&gt; -rw-r--r--  2 fletch  wheel  0 23 Nov 17:53 abc.EMB
&gt; -rw-r--r--  2 fletch  wheel  0 15 Nov 12:34 def-20041115T123400.EMB
&gt; -rw-r--r--  2 fletch  wheel  0 15 Nov 12:34 def.EMB

That will do the trick. Thanks. Now tell me you didn't do that off the top
of your head.

--
Jonathan


</pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<ul><li><strong>Follow-Ups</strong>:
<ul>
<li><strong><a name="00987" href="msg00987.html">[ale] Quick Perl Q</a></strong>
<ul><li><em>From:</em> esoteric at 3times25.net (Geoffrey)</li></ul></li>
</ul></li></ul>
<!--X-Follow-Ups-End-->
<!--X-References-->
<ul><li><strong>References</strong>:
<ul>
<li><strong><a name="00983" href="msg00983.html">[ale] Quick Perl Q</a></strong>
<ul><li><em>From:</em> fletch at phydeaux.org (Fletch)</li></ul></li>
</ul></li></ul>
<!--X-References-End-->
<!--X-BotPNI-->
<ul>
<li>Prev by Date:
<strong><a href="msg00985.html">[ale] file size limit?</a></strong>
</li>
<li>Next by Date:
<strong><a href="msg00987.html">[ale] Quick Perl Q</a></strong>
</li>
<li>Previous by thread:
<strong><a href="msg00983.html">[ale] Quick Perl Q</a></strong>
</li>
<li>Next by thread:
<strong><a href="msg00987.html">[ale] Quick Perl Q</a></strong>
</li>
<li>Index(es):
<ul>
<li><a href="maillist.html#00986"><strong>Date</strong></a></li>
<li><a href="threads.html#00986"><strong>Thread</strong></a></li>
</ul>
</li>
</ul>

<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
</body>
</html>