![]() |
![]() |
![]() |
||||
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. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
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... |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Join Date: Nov 2001
Posts: 830
|
touch ("myfile.txt");
you can include a path with the file name if need be |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
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...
![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Confirmed User
Join Date: Aug 2001
Posts: 173
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
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 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
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.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
Confirmed User
Join Date: Nov 2001
Location: padded room
Posts: 738
|
aleck
Beat me to the post :o) |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
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
![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |