system("ls") okay, system("cp") not. Why?

Reply

Join Date: Apr 2008
Posts: 2
Reputation: hansF is an unknown quantity at this point 
Solved Threads: 0
hansF hansF is offline Offline
Newbie Poster

system("ls") okay, system("cp") not. Why?

 
0
  #1
Apr 8th, 2008
Can somebody explain why the following works...

  1. <?php
  2. system("ls /home/hans/");
  3. ?>

and this not.....

  1. <?php
  2. system("cp /home/hans/data.txt /home/hans/data.tx2");
  3. ?>

For the life of me, I can't figure it out. I simply want to copy a file, so why won't php let me do this? Please help, because I'm getting a little frustrated. --Hans
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 569
Reputation: ryan_vietnow is an unknown quantity at this point 
Solved Threads: 71
ryan_vietnow's Avatar
ryan_vietnow ryan_vietnow is offline Offline
Posting Pro

Re: system("ls") okay, system("cp") not. Why?

 
0
  #2
Apr 8th, 2008
hmm..

Maybe check the file permission of the folder,maybe the permission is limited.try to change it to 777.
Last edited by ryan_vietnow; Apr 8th, 2008 at 4:39 am.
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 26
Reputation: vl4kn0 is an unknown quantity at this point 
Solved Threads: 4
vl4kn0's Avatar
vl4kn0 vl4kn0 is offline Offline
Light Poster

Re: system("ls") okay, system("cp") not. Why?

 
0
  #3
Apr 8th, 2008
do you run this script as owner of this home directory? or you can try chmod 777
Keep in mind that I'm not native english speaker....
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the PHP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC