![]() |
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... |
touch ("myfile.txt");
you can include a path with the file name if need be |
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... http://bbs.gofuckyourself.net/board/biggrin.gif
|
|
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. ------------------ http://cyfrocash.com/adverts/button.gif PlatinumBucks - amazing conversions, 65% recurring or $30+ per signup BigPenis - $30 per signup from lifetime membership |
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.
|
aleck
Beat me to the post :o) |
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 http://bbs.gofuckyourself.net/board/smile.gif
|
All times are GMT -7. The time now is 10:14 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123