Problems Adding to a file...
Moderator: General Moderators
-
mindmeddler2002
- Forum Newbie
- Posts: 21
- Joined: Mon Nov 04, 2002 3:09 pm
- Location: US, PA, Harrisuburg
Problems Adding to a file...
Ok,
first of all, its been a while...
secound... This never happened before to me....
*In Theory*
I got a file, that is made up of TONS of lines.
All I want to do is add a line to the bottom....
Simple right..
wrong.
I tried a few ways.
I tried just fput it into the file after it was opened...
All it did was replace the whole file with 1 line....
I tried sevaral ways of doing this.
Includeing copying the files contents into a varabile, and then fputing it back.... Figuring since it replaced it.
Nope.
This first way I tried was saving the info, then unlinking it, then remaking it, and saving.
Copy, Deleate, Remake, Past.
Basicly...
When I did this before I had to use that for some reason...
Anyways I get a unlink failure.
When I make it so that there is no unlink failure
(had to move folders and files around, some hidden permisions or something on XP)
IT REPLACES THE FILE AGAIN WITH ONE LINE!!!
I spent 7 hours working on syntax and stuff...
I even tried to download the file to a array, then put it back in...
Just wont work (my code on the last one was a little off I think)
Anyways,
SUGGESTIONS NEEDED PLEASE....
Thanks!
first of all, its been a while...
secound... This never happened before to me....
*In Theory*
I got a file, that is made up of TONS of lines.
All I want to do is add a line to the bottom....
Simple right..
wrong.
I tried a few ways.
I tried just fput it into the file after it was opened...
All it did was replace the whole file with 1 line....
I tried sevaral ways of doing this.
Includeing copying the files contents into a varabile, and then fputing it back.... Figuring since it replaced it.
Nope.
This first way I tried was saving the info, then unlinking it, then remaking it, and saving.
Copy, Deleate, Remake, Past.
Basicly...
When I did this before I had to use that for some reason...
Anyways I get a unlink failure.
When I make it so that there is no unlink failure
(had to move folders and files around, some hidden permisions or something on XP)
IT REPLACES THE FILE AGAIN WITH ONE LINE!!!
I spent 7 hours working on syntax and stuff...
I even tried to download the file to a array, then put it back in...
Just wont work (my code on the last one was a little off I think)
Anyways,
SUGGESTIONS NEEDED PLEASE....
Thanks!
http://www.php.net/manual/en/function.f ... quote]mode specifies the type of access you require to the stream. It may be any of the following:
...
'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. [/quote]
...
'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. [/quote]
-
mindmeddler2002
- Forum Newbie
- Posts: 21
- Joined: Mon Nov 04, 2002 3:09 pm
- Location: US, PA, Harrisuburg
Did that...
I did use a and a+
it would either replace the file itself, or give me a array to string conversion error....
got anything better?
it would either replace the file itself, or give me a array to string conversion error....
got anything better?
uh?or give me a array to string conversion error....
Code: Select all
$fd = fopen($filename, 'a') or die("it's all over");
fputs($fd, "appending new string\n");
fclose($fd);-
mindmeddler2002
- Forum Newbie
- Posts: 21
- Joined: Mon Nov 04, 2002 3:09 pm
- Location: US, PA, Harrisuburg
figured it out
Ok...
Here was the problem...
Bare with me this is a new one on me...
Apparently when i checked the file, i alwasy tried to edit it.
It was either that and it changed the file permisions....
Or the account, that i was logged in with had its own error that i found later. Apparently when I edited the account, it changed the permissions once again.
Something with XP...
Folders and files i create cant be edited with PHP unless i make it with PHP...
Any suggestions?
Here was the problem...
Bare with me this is a new one on me...
Apparently when i checked the file, i alwasy tried to edit it.
It was either that and it changed the file permisions....
Or the account, that i was logged in with had its own error that i found later. Apparently when I edited the account, it changed the permissions once again.
Something with XP...
Folders and files i create cant be edited with PHP unless i make it with PHP...
Any suggestions?
-
mindmeddler2002
- Forum Newbie
- Posts: 21
- Joined: Mon Nov 04, 2002 3:09 pm
- Location: US, PA, Harrisuburg
it is
the root is, its when i add a new folder or file that it changes just that file back....
with permission inheritage enabled? How do you create that folder?
I'm running w2k and totally agree with microsoft's own statement if you have w2k there's no need to upgrade to XP
Don't let me be misunderstood. I know many ppl. that are pleased with XP and I wouldn't try to convience them of something else but to me it is eXtreme Problem
I'm running w2k and totally agree with microsoft's own statement if you have w2k there's no need to upgrade to XP
Don't let me be misunderstood. I know many ppl. that are pleased with XP and I wouldn't try to convience them of something else but to me it is eXtreme Problem
-
mindmeddler2002
- Forum Newbie
- Posts: 21
- Joined: Mon Nov 04, 2002 3:09 pm
- Location: US, PA, Harrisuburg
reason for XP
Well see this computer was originally built to be a server...
aluminum case and powe supply.
Then i found where i use to live, with DSL
they blocked port 80 and 8080 and 88
horrible huh
anyways...
i moved and have cable now (works great and is faster cause i am the only person in my loop, get awsome speeds)
anyways, cause i thought it was not going to be a server, i installed some nice things, like TV tunner (ati all in wonder card) and a creative audigy platnum ex drive (got the best sound)
anyways, and some other special stuff....
2k would suck with this.
i had a labtop and 2k would not reconize the NIC card. A NIC CARD!
anyways... that and it really hated the active matrix display... its not TV not suppose to get horizontal lines cause the attena does not work....
ect ect ect
i have tons of problems....
besides xp comes with a newer IIS
come over to the dark side
volka i am ur father
wait j/k
aluminum case and powe supply.
Then i found where i use to live, with DSL
they blocked port 80 and 8080 and 88
horrible huh
anyways...
i moved and have cable now (works great and is faster cause i am the only person in my loop, get awsome speeds)
anyways, cause i thought it was not going to be a server, i installed some nice things, like TV tunner (ati all in wonder card) and a creative audigy platnum ex drive (got the best sound)
anyways, and some other special stuff....
2k would suck with this.
i had a labtop and 2k would not reconize the NIC card. A NIC CARD!
anyways... that and it really hated the active matrix display... its not TV not suppose to get horizontal lines cause the attena does not work....
ect ect ect
i have tons of problems....
besides xp comes with a newer IIS
come over to the dark side
volka i am ur father
wait j/k
Never! 
I suffered too long SuSE-linux's firewall to appreciate ANY preinstalled firewall and I'm under the impression "the more colors the more trouble"
I hate the idea of installing software to prevent my OS from phoning home.
no, serious, I have no need for XP, even my notebook works perfect with w2k. No new OS until INCREDIBLE features I CAN'T live without are available, no new hardware until the current is burned out
I suffered too long SuSE-linux's firewall to appreciate ANY preinstalled firewall and I'm under the impression "the more colors the more trouble"
I hate the idea of installing software to prevent my OS from phoning home.
no, serious, I have no need for XP, even my notebook works perfect with w2k. No new OS until INCREDIBLE features I CAN'T live without are available, no new hardware until the current is burned out
-
mindmeddler2002
- Forum Newbie
- Posts: 21
- Joined: Mon Nov 04, 2002 3:09 pm
- Location: US, PA, Harrisuburg
lol ok let me finish this
The BEST OS IN HISTORY!
Linux in the Raw!
2nd is Mac OS
belive it or not mac os is kind of like communism.
it has good ideas and intent, just does not work...
then the 3rd is windows 95, the only original copy of windows with a good GUI and no problems....
it was the only stable os windows made. BTW< XP DOES HAVE A BLUE SCREEN OF DEATH.
i saw mac over windows, cause i seen a few versions that actually were inovative... way more than windows....
personally...
my fav OS is IOS v 11.2 in a cisco router...
why?
cause it is simple. and does what it needs to.
mwahaha
Linux in the Raw!
2nd is Mac OS
belive it or not mac os is kind of like communism.
it has good ideas and intent, just does not work...
then the 3rd is windows 95, the only original copy of windows with a good GUI and no problems....
it was the only stable os windows made. BTW< XP DOES HAVE A BLUE SCREEN OF DEATH.
i saw mac over windows, cause i seen a few versions that actually were inovative... way more than windows....
personally...
my fav OS is IOS v 11.2 in a cisco router...
why?
cause it is simple. and does what it needs to.
mwahaha
-
mindmeddler2002
- Forum Newbie
- Posts: 21
- Joined: Mon Nov 04, 2002 3:09 pm
- Location: US, PA, Harrisuburg
lindows
now all we need is a mac os and novel combo...
macovel OS
...
lindows is a little bit weird. I hear bad things...
its just linux using whine...
but i hear it does not set up right or something
macovel OS
...
lindows is a little bit weird. I hear bad things...
its just linux using whine...
but i hear it does not set up right or something