Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2006-11-15
3
Medium Priority
?
252 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.

661 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