#23687 [Opn->Fbk]: Permission denied error with unlink()

From: Date: Sun, 18 May 2003 22:09:10 +0000
Subject: #23687 [Opn->Fbk]: Permission denied error with unlink()
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-39911@lists.php.net to get a copy of this message
 ID:               23687
 Updated by:       wez@php.net
 Reported By:      a dot eibach at gmx dot net
-Status:           Open
+Status:           Feedback
 Bug Type:         Filesystem function related
 Operating System: Windows 2000
 PHP Version:      4.3.2RC3
 New Comment:

Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

Thank you for your interest in PHP.





Previous Comments:
------------------------------------------------------------------------

[2003-05-18 17:07:42] a dot eibach at gmx dot net

to sniper:

actually, this was problems with rename(), not unlink() at first
instant in my script.
But since I claim to know that rename() does a copy(), then uses
unlink() afterwards, the 'perm. denied' error hadn't to do with
rename(), but with unlink().

Yes, rmdir() works now (THANKS!) but I still have problems with
unlink()'ing files sometimes.
I admit this script was a very bad example. :|
I tried to keep it simple, but that was too simple...

------------------------------------------------------------------------

[2003-05-18 17:05:58] wez@php.net

php.net/rmdir


------------------------------------------------------------------------

[2003-05-18 17:03:51] a dot eibach at gmx dot net

Well, Windows seems to be *VERY* sensitive about this.
This thing didn't let me loose, and I just used the Task Manager and
killed the 'Explorer' Task - another one was initiated by Windows.
Now it worked!

I will test this through further and append some delays using sleep().
It might be that actions just get executed _too fast_ and Windows can't
follow as quickly as Linux.

------------------------------------------------------------------------

[2003-05-18 16:59:10] sniper@php.net

Try reading the manual sometimes..file != directory.


------------------------------------------------------------------------

[2003-05-18 16:19:57] a dot eibach at gmx dot net

Hi.

I can see this has been discussed multiple times in this forum:
however, there's no real solution for it, it seems.

First my specs:

- Apache 1.3.27 (<- could that be it?)
- PHP 4.3.2 RC3 (PHP running as a *module* (dll))
- Win2k

I scanned the news groups about this problem, where lots of people
claimed this to work. However, even such a simple script here:

<?php
if (!is_dir("thisisatest"))
{
 mkdir ("thisisatest");
}
else echo "Dir creation skipped. Dir already exists.";

echo "Waiting ...";

sleep(3);

echo "done.";

unlink ("thisisatest");

?>


fails on my system with a Permission denied error.
Tips to 'chmod' the current directory are fruitless, because this is
WINDOWS and not UNIX and there are no permissions like this.
I do not intend to use OS-specific stuff like 'del' or 'rm', combined
with the system() command.
I also tested with PHP 4.0.6 and also failed.

Warning: Unlink failed (Permission denied) in
d:\devel\www\apache\apache\htdocs\testme.php on line 14

I'd be happy if you could help me with this and/or fix this problem
with Windows systems.
Some php ML entry told about this being fixed shortly after 4.0.x, but
this might as well have been another issue.

Thanks.
-ae-



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=23687&edit=1



Thread (10 messages)

« previous php.bugs (#39911) next »