<?xml version="1.0" encoding="utf-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Perl move files script</title>
	<atom:link href="http://www.bradrice.com/wposx/archives/59/feed" rel="self" type="application/rss+xml" />
	<link>http://www.bradrice.com/wposx/archives/59</link>
	<description>This site is about scripting with a particular emphasis on OS X. Other things OS X, too.</description>
	<pubDate>Sun, 20 Jul 2008 22:11:12 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: bradrice</title>
		<link>http://www.bradrice.com/wposx/archives/59#comment-287</link>
		<dc:creator>bradrice</dc:creator>
		<pubDate>Sun, 28 May 2006 22:45:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.bradrice.com/wposx/?p=59#comment-287</guid>
		<description>That take it down a level. I use an array, because often times I need the array for additional processing, but you are right, that would work. If you want to move the file just replace copy with move. Both subs come in with the File::Copy package. I usually find myself both making a copy and a move in the same routine.&lt;!-- X-spaminator-strike: whitelist, -3 --&gt;&lt;!-- X-spaminator-passed: IP check --&gt;&lt;!-- X-spaminator-passed: email check --&gt;&lt;!-- X-spaminator-passed: author url --&gt;&lt;!-- X-spaminator-passed: comment body --&gt;</description>
		<content:encoded><![CDATA[<p>That take it down a level. I use an array, because often times I need the array for additional processing, but you are right, that would work. If you want to move the file just replace copy with move. Both subs come in with the File::Copy package. I usually find myself both making a copy and a move in the same routine.<!-- X-spaminator-strike: whitelist, -3 --><!-- X-spaminator-passed: IP check --><!-- X-spaminator-passed: email check --><!-- X-spaminator-passed: author url --><!-- X-spaminator-passed: comment body --></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: MI</title>
		<link>http://www.bradrice.com/wposx/archives/59#comment-286</link>
		<dc:creator>MI</dc:creator>
		<pubDate>Sun, 28 May 2006 14:15:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.bradrice.com/wposx/?p=59#comment-286</guid>
		<description>Came across your script while searching how to move a file. However, you don't seem to be moving them at all. You copy them.

And, BTW, I don't see the point of the @movelist array. Why not something like:

#!/usr/bin/perl
use File::Copy;

my $movefile;
my @dirfile;

my $srcpath = '/Volumes/Users/Admin/Sites/clientfiles/pdf/';
my $movepath = '/Volumes/10.1.5.235/pdfs/';

open (MOVELIST, â€˜/Users/bradrice/bin/keypdflist.txtâ€™);
while (&#60;MOVELIST&#62;) {
  chomp $_;
  $new = $_ . ".pdf" unless /\.pdf$/i;
  print â€œ$srcpath$movefileâ€.â€ â€” â€œ. â€œ$movepath$newâ€.â€\nâ€;
  copy(â€$srcpath$movefileâ€, â€œ$newâ€);
}

(But that is still a copy, not a move)</description>
		<content:encoded><![CDATA[<p>Came across your script while searching how to move a file. However, you don&#8217;t seem to be moving them at all. You copy them.</p>
<p>And, BTW, I don&#8217;t see the point of the @movelist array. Why not something like:</p>
<p>#!/usr/bin/perl<br />
use File::Copy;</p>
<p>my $movefile;<br />
my @dirfile;</p>
<p>my $srcpath = &#8216;/Volumes/Users/Admin/Sites/clientfiles/pdf/&#8217;;<br />
my $movepath = &#8216;/Volumes/10.1.5.235/pdfs/&#8217;;</p>
<p>open (MOVELIST, â€˜/Users/bradrice/bin/keypdflist.txtâ€™);<br />
while (&lt;MOVELIST&gt;) {<br />
  chomp $_;<br />
  $new = $_ . &#8220;.pdf&#8221; unless /\.pdf$/i;<br />
  print â€œ$srcpath$movefileâ€.â€ â€” â€œ. â€œ$movepath$newâ€.â€\nâ€;<br />
  copy(â€$srcpath$movefileâ€, â€œ$newâ€);<br />
}</p>
<p>(But that is still a copy, not a move)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrei Popov</title>
		<link>http://www.bradrice.com/wposx/archives/59#comment-113</link>
		<dc:creator>Andrei Popov</dc:creator>
		<pubDate>Fri, 30 Dec 2005 07:29:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.bradrice.com/wposx/?p=59#comment-113</guid>
		<description>#! /bin/sh
ext=.pdf
movefile=/Users/bradrice/bin/keypdflist.txt
srcpath = /Volumes/Users/Admin/Sites/clientfiles/pdf/
movepath = /Volumes/10.1.5.235/pdfs/
for i in `cat $movefile`
do
cp $srcpath/$i $movepath/$i$ext
echo "$srcpath/$i -&#62; $movepath/$i$ext"
done</description>
		<content:encoded><![CDATA[<p>#! /bin/sh<br />
ext=.pdf<br />
movefile=/Users/bradrice/bin/keypdflist.txt<br />
srcpath = /Volumes/Users/Admin/Sites/clientfiles/pdf/<br />
movepath = /Volumes/10.1.5.235/pdfs/<br />
for i in `cat $movefile`<br />
do<br />
cp $srcpath/$i $movepath/$i$ext<br />
echo &#8220;$srcpath/$i -&gt; $movepath/$i$ext&#8221;<br />
done</p>
]]></content:encoded>
	</item>
</channel>
</rss>
