Re: copy error
- From: xhoster@xxxxxxxxx
- Date: 09 Jan 2006 17:25:16 GMT
jtbutlerhvb@xxxxxxxxxxx wrote:
> When I try to copy a file I get the message 'No such file or
> directory'. I know the file is there and I know the path is correct
> because in fact the file does copy. However some of my files are not
> copying correctly and I am trying to figure out why so I am logging
> everything.
>
> #here is my code
> for () {
> ...
>
> $BAK->logMsg( "Copying $today\\$move_cube_name[4] to
> $yesterday\\$move_cube_name[4]" .
> copy("$today\\$move_cube_name[4]","$yesterday\\$move_cube_name[4]") .
> $!) ;
> #reset $! each time through loop
> $! = '';
You are inspecting $! unconditionally. The contents of $! only make sense
if the call actually failed. So what you are seeing is that somewhere
along the line, something that "copy" does is failing with that message,
but the "copy" itself does not fail, presumably because it successfully
recovers from the error.
> The above code is logged and it produces this output but the file is
> copied. It also returns a '1' which I dont not understand since it
> copied. Shouldnt it be '0'?
Have you read the documentation for the module you are using? What did
it say about the return value of "copy".
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
.
- Follow-Ups:
- Re: copy error
- From: jtbutlerhvb
- Re: copy error
- From: jtbutlerhvb
- Re: copy error
- References:
- copy error
- From: jtbutlerhvb
- copy error
- Prev by Date: Re: copy error
- Next by Date: Re: Email from a flat file database
- Previous by thread: Re: copy error
- Next by thread: Re: copy error
- Index(es):
Relevant Pages
|