[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
- <!--x-content-type: text/plain -->
- <!--x-date: Tue Nov 23 21:17:50 2004 -->
- <!--x-from-r13: wqe ng kpbecf.arg (Xbanguna Dvpxzna) -->
- <!--x-message-id: 04Nov23.211540-0500_est.360711-[email protected] -->
- <!--x-reference: [email protected] --> "http://www.w3.org/TR/html4/loose.dtd">
- <!--x-subject: [ale] Quick Perl Q -->
- <li><em>date</em>: Tue Nov 23 21:17:50 2004</li>
- <li><em>from</em>: jdr at xcorps.net (Jonathan Rickman)</li>
- <li><em>in-reply-to</em>: <<a href="msg00983.html">[email protected]</a>></li>
- <li><em>subject</em>: [ale] Quick Perl Q</li>
> -----Original Message-----
> From: ale-bounces at ale.org [<a rel="nofollow" href="mailto:ale-bounces">mailto:ale-bounces</a> at ale.org] On
> Behalf Of Fletch
> Sent: Tuesday, November 23, 2004 6:10 PM
> To: Atlanta Linux Enthusiasts
> Subject: Re: [ale] Quick Perl Q
>
>
> I'd use link() (or symlink) rather than copy() unless you
> really want a duplicate file to muck with, but that's just me.
>
> lemur:/tmp/foo 724> l
> total 0
> -rw-r--r-- 1 fletch wheel 0 23 Nov 17:53 abc.EMB
> -rw-r--r-- 1 fletch wheel 0 15 Nov 12:34 def.EMB
> lemur:/tmp/foo 725> perl -MPOSIX=strftime -le
> 'for(<*.EMB>){m{(.*?)\.EMB$};unless($m=(stat$_)[9]){warn"canno
> t stat $_:
> $!\n";next}link($_,strftime("$1-%Y%m%dT%H%M%S.EMB",localtime$m
> ))||warn"cannot link $_: $!\n"}'
> lemur:/tmp/foo 726> l
> total 0
> -rw-r--r-- 2 fletch wheel 0 23 Nov 17:53 abc-20041123T175315.EMB
> -rw-r--r-- 2 fletch wheel 0 23 Nov 17:53 abc.EMB
> -rw-r--r-- 2 fletch wheel 0 15 Nov 12:34 def-20041115T123400.EMB
> -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>