Linux / Unix difference
| From: | Patrick ALLAERT | Date: | Thu, 23 Jul 2009 11:24:58 +0000 |
| Subject: | Linux / Unix difference | ||
| Groups: | php.qa | ||
| Request: | Send a blank email to php-qa+get-65240@lists.php.net to get a copy of this message | ||
Hi,
I just wanted to drop a note about an annoying difference between
Linux and Unix (at least some Solaris and HP-UX) regarding pathname
resolution:
Linux:
$ touch /tmp/test
$ cat /tmp/test
$ cat /tmp/test/
cat: /tmp/test/: Not a directory
$ file /tmp/test
/tmp/test: empty
$ file /tmp/test/
/tmp/test/: cannot open `/tmp/test/' (Not a directory)
Solaris:
$ touch /tmp/test
$ cat /tmp/test
$ cat /tmp/test/
$ file /tmp/test
/tmp/test: empty file
$ file /tmp/test/
/tmp/test/: empty file
As you see, Unix system calls let you access a file using a *trailing
slash*. Linux (and apparently BSD's) not.
Taking this into account, phpt tests files shouldn't test those edge
case like it is currently the case with:
ext/standard/tests/file/filegroup_variation3.phpt
ext/standard/tests/file/fileinode_variation3.phpt
ext/standard/tests/file/fileowner_variation3.phpt
ext/standard/tests/file/fileperms_variation3.phpt
... and possibly others.
I will fix them,
Cheers.
--
Patrick Allaert
---
http://code.google.com/p/peclapm/ - Alternative PHP
Monitor