Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

how do i create a file with permissions set the way i want them.

Posted on 2006-11-15
3
Medium Priority
?
255 Views
Last Modified: 2006-11-18
i'm using fopen to create and open a file. it creates the file however it's permissions are 0644. of course the drag is i can't edit the file in my ftp program nor change the permissions because i don't have permission.

i can't use chmod on my server. is there any way to set the permissions when you create the file??

'create file x and set the permissions to 0666' or something like that??

thanks for looking this over.
tony miceli
0
Comment
Question by:tjazzvibe
  • 2
3 Comments
 
LVL 19

Accepted Solution

by:
VoteyDisciple earned 1000 total points
ID: 17952110
If PHP can create the file surely it can chmod it too?  http://us2.php.net/chmod

Alterantively, PHP will let you set the umask the same as you could on a server: http://us2.php.net/manual/en/function.umask.php

Set the umask you want first and then create the file; it should come out fine.
0
 

Author Comment

by:tjazzvibe
ID: 17952606
umask did the trick. thanks!

i can't set anything to 777, i can do 666 but 0's don't get me anywhere. ones do 666.

i don't know a ton about all this, i'm just learning. maybe i'm doing something wrong. but for now this works.

thanks for your help
tony
0
 

Author Comment

by:tjazzvibe
ID: 17952613
ps i can't use chmod at all with my server.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

877 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question