/    Sign up×
Community /Pin to ProfileBookmark

copy a directory on the server??

This has me a little stumped. Is there a way to copy a whole directory on the server, i.e. make a duplicate of it?

copy() reports a permissions error because the directory has files inside it. permissions aren’t a problem because I can happily delete directories even if they have files in, just not copy, apparently.

Is there a simple duplication method, or will I have to do it the long way with mkdir() and by copying over each and every file?

Thanks in advance.

to post a comment
PHP

8 Comments(s)

Copy linkTweet thisAlerts:
@JonaJun 02.2004 — [font=arial]What are the file permissions of the folder you're trying to copy?[/font]
Copy linkTweet thisAlerts:
@mityaauthorJun 02.2004 — I'm on my local testing server, which is windows so there's no CHMOD involved. In short, I don't know.

Are you saying this would work on a non-windows server (which is where this will eventually end up) providing the CHMOD was set high enough?
Copy linkTweet thisAlerts:
@JonaJun 02.2004 — [font=arial]I'm pretty sure Windows does have file permissions, but they're rarely ever a problem. I have a local testing server as well, but haven't had any such problems. If possible, I'd suggest trying to put it on a *NIX server and testing it there.[/font]
Copy linkTweet thisAlerts:
@96turnerriJun 03.2004 — [i]Originally posted by mitya [/i]

[B]I'm on my local testing server, which is windows so there's no CHMOD involved.[/B][/QUOTE]


hmmmm, i think it does
Copy linkTweet thisAlerts:
@JonaJun 03.2004 — [font=arial]It does have file permissions. I created a directory indexing PHP script, which lists the files of a directory, their file size, their file type (extension), and their file permissions. Most of the files say "666." It says this on my local testing server, so there are file permissions. Try checking out the CHMOD function at PHP.net[/font]
Copy linkTweet thisAlerts:
@mityaauthorJun 03.2004 — Hmm, I meant you can't right click on a windows folder and edit its chmod. There's no link for it in the context menu in windows explorer mode.

Thanks anyway.
Copy linkTweet thisAlerts:
@96turnerriJun 03.2004 — right click on file/folder and go properties its in there
Copy linkTweet thisAlerts:
@JonaJun 04.2004 — [i]Originally posted by 96turnerri [/i]

[B]right click on file/folder and go properties its in there [/B][/QUOTE]


[font=arial]In the form of "read-only, archive," or, "hidden"?[/font]
×

Success!

Help @mitya spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...