Solved

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

Posted on 2006-11-15
3
205 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 250 total points
Comment Utility
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
Comment Utility
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
Comment Utility
ps i can't use chmod at all with my server.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
These days socially coordinated efforts have turned into a critical requirement for enterprises.
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.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

763 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now