Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Mar 2005
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How-to: Replace files in directory

    I don't normally work at the OS file system level when using PHP and have never tried this, but I know it's gotta be possible. What I want to do is write a script that will replace files in one directory with files from another directory when invoked (even if there are already files there). Anybody ever do this? I know it would require the script to have certain permissions (this is on a Win2k3 Server). Any advice on where to get started would be appreciated!

  • #2
    Regular Coder ralph l mayo's Avatar
    Join Date
    Nov 2005
    Posts
    951
    Thanks
    1
    Thanked 31 Times in 29 Posts
    The copy() function overwrites existing files. Someone in the manual linked this recursive copying function, which looks like a good start.

  • #3
    New to the CF scene
    Join Date
    Mar 2005
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ok, I've implemented a routine that will copy files like needed; however, I'm now having problems with Windows permissions.

    I'm trying to use the PHP copy() function but do not know how to configure Windows permissions to get it to work correctly. Does anyone have any pointers? I don't want to create a security risk here.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •