Re: is_link() behavior
| From: | Andi Gutmans | Date: | Wed, 25 Apr 2001 07:33:47 +0000 |
| Subject: | Re: is_link() behavior | ||
| References: | 1 2 3 4 5 6 7 8 9 10 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-52362@lists.php.net to get a copy of this message | ||
At 01:19 AM 4/25/2001 -0500, J. Jones wrote:
On Wed, Apr 25, 2001 at 01:05:00AM -0500, J. Jones wrote: On Wed, Apr 25, 2001 at 08:56:47AM +0200, Andi Gutmans wrote:OK. I commited one more patch which should fix filetype() and lstat(). I'd appreciate it if you can take a minute and just make sure they work now and that I didn't cause any problems with the fixed is_link(). It's not my code so that's why I'm messing with it slowly. It had some dependencies inside the code and I wanted to make sure I keep it consistent. AndiI commited another fix. is_link() should work correctly now. If things have improved and youhaveproblems with lstat() and filetype() (which I think there's a goodchancethat they are screwed up) let me know. Thanks, Andi--new output :(01:02am ~/php): ./fs-test.php is_link passed readlink passed: /bin/false filetype passed: link lstat passed: Array ([0] => 770 [1] => 749 [2] => 41471 [3] => 1 [4] => 0 [5] => 0 [6] => 0 [7] => 10 [8] => 988178527 [9] => 988178527 [10] => 988178527 [11] => 4096 [12] => 1) is_link passed readlink passed: /this/file/does/not/exist Warning: stat failed for /tmp/test-link-func (errno=2 - No such file or directory) in ./fs-test.php on line 11 filetype failed Warning: stat failed for /tmp/test-link-func (errno=2 - No such file or directory) in ./fs-test.php on line 14 lstat failed --end Ok.. is_link() and readlink() (I realize this is in a separate section, but I still use it as opposed to lstat() to get the link's target) are the only two functions that work on broken symlinks. filetype(), lstat(), and file_exists() all fail (the latter probably should, eh?). I assume all the file<someinfo>() functions will fail also, since they are based on lstat() or stat().