.txt file not writeabubble !!

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

AimSkyward
New php-forum User
New php-forum User
Posts: 6
Joined: Mon Jul 22, 2013 10:42 am

.txt file not writeabubble !!

Postby AimSkyward » Sat Aug 03, 2013 8:31 am

Hi all,

I am trying to do something really simple, writing basic text to a .txt file. I have a test.txt file ready to go, have checked the permissions and the current user is the owner and has read and write permissions.
At the start of the <?php script I do the following checks:

Code: Select all

if(file_exists("test.txt")){
echo "File exists - "
if(is_readable("test.txt")){
echo "is readable - "
if(is_writeable("test.txt")){
echo "is writeable - "

I get the first two echos, so it both exists and is readable but apparently it is not writeable.
Any ideas would be appreciated.

AimSkyward
New php-forum User
New php-forum User
Posts: 6
Joined: Mon Jul 22, 2013 10:42 am

Re: .txt file not writeabubble !!

Postby AimSkyward » Sat Aug 03, 2013 8:44 am

SOLVED:

After a bit of tinkering I ended up deleting the file - creating a new one - set the 777 permissions and all is rosy. I have now converted it back to only the owner having both read and write permissions and all still works. :)


Return to “PHP coding => General”

Who is online

Users browsing this forum: No registered users and 1 guest

cron