On win32 systems, stat often returns 0 for size when called for a directory. Some documentation suggests that it may sometimes return non-zero for directory size in some circumstances, but I haven't seen it myself. The '-s' file test is based on stat, so '-s' will often return 0 when used on a directory.
It might help you solve your problem if you check the return from the move function. See File::Copy for details. Maybe something like the following:
move( $source, $destination ) or die "move( $source, $destination ) fa
+iled: $!";
The error message should help you understand why the move failed. On the other hand, testing I have done on Windows XP suggests that the error messages are not very good: in my tests it returned "No such file or directory" regardless of what the actual problem was. Also, while move worked for directories within a file system, copy didn't. Neither move nor copy worked for directories when moving or copying from one drive to another but move and copy both worked when moving or copying a file from one drive to another. So it seems that File::Copy is somewhat broken, at least for Active State perl 5.10.0 on Windows XP.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|