You are here: Help with the copy command... « PHP « IT news, forums, messages
Help with the copy command...

Posted by Tim Meader on 12/15/05 21:27

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация