Development Articles
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOtherDevelopment Articles

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 7th, 2003, 10:28 AM
Ducani
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
File And Directory Manipulation In PHP (part 1)

File And Directory Manipulation In PHP \(part 1\)

PHP comes with a powerful and flexible file manipulation API that allows developers (among other things) to read and write files, view and modify file attributes, read and list directory contents, alter file permissions, and retrieve file contents into a variety of native data structures. Find out more, inside.

Discuss this article in this thread. You can read the article here .

Reply With Quote
  #2  
Old August 14th, 2003, 02:32 AM
traverse's Avatar
traverse traverse is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 35 traverse User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via ICQ to traverse
I'm curious about the permissions settings for file writing. When I am trying to create a file in a subfolder and write to it I have to set that folder's permissions to full access. Otherwise I get errors from php telling me that I don't have permission.

Any thoughts?

Travis

Reply With Quote
  #3  
Old August 14th, 2003, 02:49 AM
a.koepke's Avatar
a.koepke a.koepke is offline
Second highest poster :p
Dev Shed God 5th Plane (7000 - 7499 posts)
 
Join Date: Jul 2001
Posts: 7,323 a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 8 h 13 m 55 sec
Reputation Power: 27
Yes that is because PHP runs as the user the webserver runs as, either nobody or apache. The user the webserver runs as need to have permission to write to the folder, hence why you need to chmod the file as 777

Reply With Quote
  #4  
Old August 14th, 2003, 12:07 PM
traverse's Avatar
traverse traverse is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 35 traverse User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via ICQ to traverse
I did find this thread:

http://forums.devshed.com/t76052/s.html

About half way down they begin talking about setting up permissions for a group so that you dont have to chmod 777.

I haven't played with it yet, but I thought someone else might see this and find it useful.

Travis

Reply With Quote
  #5  
Old January 19th, 2004, 12:13 PM
williambericson williambericson is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 1 williambericson User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via Yahoo to williambericson
Angry File And Directory Manipulation In PHP (part 1)

Disk drives like c:\ or d:\ or e:\ are part of reality when it comes to novices dealing with pathnames in doing file and directory manipulation with php in windows.

I did not see any mention of drive letters in any of the path examples. I did not see any discussion of problems a novice might encounter with a pathname like d:/foo/boo/file.txt

Without this - I do not think part 1 and part 2 will allow a novice to manipulate files or directories of interest. Or is it just me?

Reply With Quote
  #6  
Old May 31st, 2004, 09:14 AM
Dieter's Avatar
Dieter Dieter is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Location: SA, Centurion
Posts: 305 Dieter User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 5 h 16 m 26 sec
Reputation Power: 6
Thanks for this great article.

I have however one question that nobody can seem to help me with, I've posted a few times on various forums:

How can I read apart of a .txt file(by checking for tags) and then copy that part to another new .txt file ?

Attached is a .txt I want to read. PHP must break the file each time it reads a <sender> tag, and write the report to a new file that's going to be emailed.

PLEASE HELP ME ON THIS AS I'M STRUGGLING WITH THIS FOR 4 WEEKS NOW

thanks in advance
Attached Files
File Type: txt EMAIL.TXT (9.9 KB, 357 views)
__________________
:P

Reply With Quote
Reply

Viewing: Dev Shed ForumsOtherDevelopment Articles > File And Directory Manipulation In PHP (part 1)


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT