Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 12-09-2001, 08:41 PM   #1
FADE19
Snow's Parole Officer
 
Join Date: Sep 2001
Location: mud hut next to Bin Laden's
Posts: 1,161
Yet another PHP question....

Ok,
I have figured out how to
1)Write to a file
2)Read a file
3)Copy a file
4)Delete a file

but how the hell do you create a file??? programmatically?? I know I can go in there and add a file yes...but how do you create one via code? thanks in advance...
FADE19 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-09-2001, 08:45 PM   #2
Ted
Confirmed User
 
Join Date: Nov 2001
Posts: 830
touch ("myfile.txt");

you can include a path with the file name if need be
Ted is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-09-2001, 08:48 PM   #3
FADE19
Snow's Parole Officer
 
Join Date: Sep 2001
Location: mud hut next to Bin Laden's
Posts: 1,161
Thanks Ted, I have 5 different PHP books here and not one of them explains shit about how to create a file...time to update my book selection...
FADE19 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-09-2001, 08:52 PM   #4
Matt
Confirmed User
 
Join Date: Aug 2001
Posts: 173
http://www.php.net/manual/en/ref.filesystem.php
Matt is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-09-2001, 08:53 PM   #5
aleck
Confirmed User
 
Join Date: Jan 2001
Posts: 940
actually if u r opening a file for writing it can be created automatically (depending on the mode tho)

mode may be any of the following:


'r' - Open for reading only; place the file pointer at the beginning of the file.

'r+' - Open for reading and writing; place the file pointer at the beginning of the file.

'w' - Open for writing only; place the file pointer at the beginning of the file and truncate the file to zero length. If the file does not exist, attempt to create it.

'w+' - Open for reading and writing; place the file pointer at the beginning of the file and truncate the file to zero length. If the file does not exist, attempt to create it.

'a' - Open for writing only; place the file pointer at the end of the file. If the file does not exist, attempt to create it.

'a+' - Open for reading and writing; place the file pointer at the end of the file. If the file does not exist, attempt to create it.



------------------

PlatinumBucks - amazing conversions, 65% recurring or $30+ per signup
BigPenis - $30 per signup from lifetime membership
aleck is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-09-2001, 08:54 PM   #6
amadman
Confirmed User
 
Join Date: Nov 2001
Location: padded room
Posts: 738
I am not sure about php but some languages create a file when you open it for writing or apending and it does not already exist.
amadman is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-09-2001, 08:56 PM   #7
amadman
Confirmed User
 
Join Date: Nov 2001
Location: padded room
Posts: 738
aleck
Beat me to the post :o)
amadman is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-09-2001, 08:57 PM   #8
FADE19
Snow's Parole Officer
 
Join Date: Sep 2001
Location: mud hut next to Bin Laden's
Posts: 1,161
I know that when you are using FSO in ASP you actually have to create the file first...it is nice switch not have to do that
FADE19 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.