Page 1 of 1
How do I append to a file in windows system?
Posted: Fri Jan 17, 2003 3:06 am
by E_Fox
This is not working on windows:
or
fanx in advance
Posted: Fri Jan 17, 2003 3:24 am
by twigletmac
Do you get any error messages?
Mac
Posted: Fri Jan 17, 2003 5:39 am
by E_Fox
No error messages, only it doesn't append to the file. It's windows NT server.
Posted: Fri Jan 17, 2003 5:52 am
by volka
works well on w2k. What does this script output?
Code: Select all
<?php
ini_set('display_errors', TRUE); // ; Print out errors (as a part of the output).
ini_set('error_reporting', E_ALL); // ; E_ALL - All errors and warnings
$file1 = fopen('list.txt', 'ab');
if ($file1)
{
fputs($file1, date('H:i:s')."\n");
echo 'done.';
}
else
echo 'failed.';
?>
Posted: Fri Jan 17, 2003 6:16 am
by E_Fox
it says:
Warning: fopen("list.txt", "ab") - Permission denied in d:\inetpub\webs\efox\writ.php on line 4
failed.
Posted: Fri Jan 17, 2003 6:28 am
by volka
then this is the error

filesystem permissions do not allow your script to write that file.
The script is not running under your account's permission settings but under the webserver's (or what ever it switched to before executing the script)
Posted: Fri Jan 17, 2003 6:38 am
by E_Fox
how do I set permission to write on windows? I can't chmod on windows

Posted: Fri Jan 17, 2003 7:13 am
by volka
e.g. by right-clicking on a file in the windows-explorer->properties->permissions(?). There you can set permissions on a user and/or group base.
You can as well change directory settings (might be nessecary).
The windows-help-system should provide more detail (e.g. inheritage of permission settings)
Posted: Fri Jan 17, 2003 7:16 am
by E_Fox
I connect through an ftp client and thanks for the help.
Posted: Fri Jan 17, 2003 7:19 am
by volka
also
Haven't read them but they look feasable
edit: oh, ftp-connection, hmmmm