Re: [PHP] Help with the copy command...

2005-12-15 Thread Hristo Yankov
The two examples you give are not the same? I see
different files. Please, doublecheck.

--- Tim Meader <[EMAIL PROTECTED]> wrote:

> Okay, this seems like a ridiculously easy question
> which shouldn't even
> need asking, but I'm having trouble getting the
> builtin copy command to
> work properly. It seems to work fine as long as I
> feed it a full
> constant string path for each argument (ie - in the
> form
> "/the/path/to/the/file"). However, if I try to feed
> it two variables as
> the arguments, it craps out somewhere along the
> line. Here are the two
> different sets of calls I'm making:
> 
> These two work perfectly:
> 
>
copy("/usr/local/apache/htdocs/ipreg2/crons/regservice_rep/snapshot.baseline",
>
"/usr/local/apache/htdocs/ipreg2/crons/regservice_rep/snapshot.baseline.bak")
> ;
>
copy("/usr/local/apache/htdocs/ipreg2/crons/regservice_rep/lastrun.timestamp",
>
"/usr/local/apache/htdocs/ipreg2/crons/regservice_rep/lastrun.timestamp.bak");
> 
> These two fail:
> 
> $l_stLastRun =
>
"/usr/local/apache/htdocs/ipreg2/crons/regservice_rep/lastrun.timestamp";
> $l_stSnapshotBase =
>
"/usr/local/apache/htdocs/ipreg2/crons/regservice_rep/snapshot.baseline";
> 
> copy($l_stSnapshotBase, $l_stSnapshotBase.".bak");
> copy($l_stLastRun, $l_stLastRun.".bak");
> 
> Can anyone offer any insight on what the problem
> might be with this? The
> "unlink" function seems to accept the variable
> inputs with absolutely no
> problem, so I can't understand the discrepancy
> between the two.
> 
> Thanks in advance.
> 
> Tim
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


===
Hristo Yankov, Developer at Portellus, Inc.
ICQ - 191445567
Yahoo! - yankov_hristo

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Help with the copy command...

2005-12-16 Thread Robin Vickery
On 12/15/05, Tim Meader <[EMAIL PROTECTED]> wrote:
> Okay, this seems like a ridiculously easy question which shouldn't even
> need asking, but I'm having trouble getting the builtin copy command to
> work properly. It seems to work fine as long as I feed it a full
> constant string path for each argument (ie - in the form
> "/the/path/to/the/file"). However, if I try to feed it two variables as
> the arguments, it craps out somewhere along the line. Here are the two
> different sets of calls I'm making:
>
> These two work perfectly:
>
> copy("/usr/local/apache/htdocs/ipreg2/crons/regservice_rep/snapshot.baseline",
> "/usr/local/apache/htdocs/ipreg2/crons/regservice_rep/snapshot.baseline.bak")
> ;
> copy("/usr/local/apache/htdocs/ipreg2/crons/regservice_rep/lastrun.timestamp",
> "/usr/local/apache/htdocs/ipreg2/crons/regservice_rep/lastrun.timestamp.bak");
>
> These two fail:
>
> $l_stLastRun =
> "/usr/local/apache/htdocs/ipreg2/crons/regservice_rep/lastrun.timestamp";
> $l_stSnapshotBase =
> "/usr/local/apache/htdocs/ipreg2/crons/regservice_rep/snapshot.baseline";
>
> copy($l_stSnapshotBase, $l_stSnapshotBase.".bak");
> copy($l_stLastRun, $l_stLastRun.".bak");
>
> Can anyone offer any insight on what the problem might be with this? The
> "unlink" function seems to accept the variable inputs with absolutely no
> problem, so I can't understand the discrepancy between the two.

There's no problem with variable names as parameters to copy() - you
can test that in a few seconds.

   $ touch foo
   $ php -a
   Interactive mode enabled

   

   $ ls
   foo   foo.bak

So the problem is elsewhere.

99 times in 100 you've either messed up the filenames or you've not
got appropriate file permissions to do the copy.

  -robin


Re: [PHP] Help with the copy command...

2005-12-16 Thread Tim Meader
What difference are you seeing in the files I give in the example? Are
they not identical paths?

Thanks.

Hristo Yankov wrote:
> The two examples you give are not the same? I see
> different files. Please, doublecheck.
> 
> --- Tim Meader <[EMAIL PROTECTED]> wrote:
> 
>> Okay, this seems like a ridiculously easy question
>> which shouldn't even
>> need asking, but I'm having trouble getting the
>> builtin copy command to
>> work properly. It seems to work fine as long as I
>> feed it a full
>> constant string path for each argument (ie - in the
>> form
>> "/the/path/to/the/file"). However, if I try to feed
>> it two variables as
>> the arguments, it craps out somewhere along the
>> line. Here are the two
>> different sets of calls I'm making:
>>
>> These two work perfectly:
>>
>>
> copy("/usr/local/apache/htdocs/ipreg2/crons/regservice_rep/snapshot.baseline",
> "/usr/local/apache/htdocs/ipreg2/crons/regservice_rep/snapshot.baseline.bak")
>> ;
>>
> copy("/usr/local/apache/htdocs/ipreg2/crons/regservice_rep/lastrun.timestamp",
> "/usr/local/apache/htdocs/ipreg2/crons/regservice_rep/lastrun.timestamp.bak");
>> These two fail:
>>
>> $l_stLastRun =
>>
> "/usr/local/apache/htdocs/ipreg2/crons/regservice_rep/lastrun.timestamp";
>> $l_stSnapshotBase =
>>
> "/usr/local/apache/htdocs/ipreg2/crons/regservice_rep/snapshot.baseline";
>> copy($l_stSnapshotBase, $l_stSnapshotBase.".bak");
>> copy($l_stLastRun, $l_stLastRun.".bak");
>>
>> Can anyone offer any insight on what the problem
>> might be with this? The
>> "unlink" function seems to accept the variable
>> inputs with absolutely no
>> problem, so I can't understand the discrepancy
>> between the two.
>>
>> Thanks in advance.
>>
>> Tim
>>
>> -- 
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
> 
> 
> ===
> Hristo Yankov, Developer at Portellus, Inc.
> ICQ - 191445567
> Yahoo! - yankov_hristo
> 
> __
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> 

-- 
Tim
[EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Help with the copy command...

2005-12-16 Thread adriano ghezzi
just put the "wrong" lines in a file and run it from the shell
with php -f
you should get more info about what's going wrong

hyh
ciao!


2005/12/16, Tim Meader <[EMAIL PROTECTED]>:
>
> What difference are you seeing in the files I give in the example? Are
> they not identical paths?
>
> Thanks.
>
> Hristo Yankov wrote:
> > The two examples you give are not the same? I see
> > different files. Please, doublecheck.
> >
> > --- Tim Meader <[EMAIL PROTECTED]> wrote:
> >
> >> Okay, this seems like a ridiculously easy question
> >> which shouldn't even
> >> need asking, but I'm having trouble getting the
> >> builtin copy command to
> >> work properly. It seems to work fine as long as I
> >> feed it a full
> >> constant string path for each argument (ie - in the
> >> form
> >> "/the/path/to/the/file"). However, if I try to feed
> >> it two variables as
> >> the arguments, it craps out somewhere along the
> >> line. Here are the two
> >> different sets of calls I'm making:
> >>
> >> These two work perfectly:
> >>
> >>
> >
> copy("/usr/local/apache/htdocs/ipreg2/crons/regservice_rep/snapshot.baseline",
> >
> "/usr/local/apache/htdocs/ipreg2/crons/regservice_rep/snapshot.baseline.bak")
> >> ;
> >>
> >
> copy("/usr/local/apache/htdocs/ipreg2/crons/regservice_rep/lastrun.timestamp",
> >
> "/usr/local/apache/htdocs/ipreg2/crons/regservice_rep/lastrun.timestamp.bak");
> >> These two fail:
> >>
> >> $l_stLastRun =
> >>
> >
> "/usr/local/apache/htdocs/ipreg2/crons/regservice_rep/lastrun.timestamp";
> >> $l_stSnapshotBase =
> >>
> >
> "/usr/local/apache/htdocs/ipreg2/crons/regservice_rep/snapshot.baseline";
> >> copy($l_stSnapshotBase, $l_stSnapshotBase.".bak");
> >> copy($l_stLastRun, $l_stLastRun.".bak");
> >>
> >> Can anyone offer any insight on what the problem
> >> might be with this? The
> >> "unlink" function seems to accept the variable
> >> inputs with absolutely no
> >> problem, so I can't understand the discrepancy
> >> between the two.
> >>
> >> Thanks in advance.
> >>
> >> Tim
> >>
> >> --
> >> PHP General Mailing List (http://www.php.net/)
> >> To unsubscribe, visit: http://www.php.net/unsub.php
> >>
> >>
> >
> >
> > ===
> > Hristo Yankov, Developer at Portellus, Inc.
> > ICQ - 191445567
> > Yahoo! - yankov_hristo
> >
> > __
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam protection around
> > http://mail.yahoo.com
> >
>
> --
> Tim
> [EMAIL PROTECTED]
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>