Thread: File Moving

    #1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    Seattle, WA,USA
    Posts
    84
    Rep Power
    15
    How can I move a file? Say like when a user signs up, I want to copy a script to thier directory, how could I do that?

    Many thanks in Advance!

    -Jerome
  2. #2
  3. No Profile Picture
    RyanP
    Guest
    Devshed Newbie (0 - 499 posts)
    if you're on unix, maybe use the exec() function or backticks and just manually move the file(s) over, be sure to use escapeShellCmd()

    or maybe the copy() function

    [This message has been edited by RyanP (edited September 02, 2000).]
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    Seattle, WA,USA
    Posts
    84
    Rep Power
    15
    I am on a Linux system, and I am really stuck. It's probably really simple.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jul 2000
    Posts
    669
    Rep Power
    15
    Why yes it is very simple, just use chdir() to get to the dir containhing the file you want to move then use copy($thefile, $destdir);
    Where $destdir is set to something like
    "/www/files/yourfile.php"

    Make sure to include the filename of the destination file where you want to copy it to

Similar Threads

  1. Pointer problem in opening a file
    By LAKI in forum C Programming
    Replies: 13
    Last Post: February 11th, 2004, 09:27 AM
  2. Pointer problems opening file *formatted*
    By LAKI in forum C Programming
    Replies: 4
    Last Post: February 11th, 2004, 07:06 AM
  3. Replies: 1
    Last Post: February 8th, 2004, 02:59 PM
  4. PHP file upload script trouble
    By casbboy in forum PHP Development
    Replies: 9
    Last Post: February 5th, 2004, 08:42 PM
  5. Overwritng contents of Binary file in C
    By nmsudhan in forum C Programming
    Replies: 3
    Last Post: January 14th, 2004, 07:43 AM

IMN logo majestic logo threadwatch logo seochat tools logo