/    Sign up×
Community /Pin to ProfileBookmark

File copying and permissions

Hi,
Ok, so I’m attempting to copy a file in one directory, to another directory. I have sufficient permissions to write, read, execute in both directories.

Thus, i call: copy($src, $dest);

The file is properly copied over, however, I cannot save any changes to the new file. Is there something I’m missing in permissions that won’t allow me to save changes, yet allows me to copy files and add new files to the directory?

Thanks for any help on this,
Jaelan

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@NogDogApr 20.2005 — Maybe you need to add write permission to the copy?
[code=php]
copy($src, $dest);
chmod($dest, 0664); # 664 = read/write for owner and group, read only for world
[/code]
Copy linkTweet thisAlerts:
@JaelanauthorApr 20.2005 — Of course...chmod()...doh!

Yeah, thanks NogDog. That worked wonders
×

Success!

Help @Jaelan 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 4.28,
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: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...