PhP触及不存在的文件返回true
我有一个函数来检查一个文件夹是否可写。 但是当我尝试使用它像这样的PHP触摸变量
public function isFileServerMounted()
{
    $config = $this->getServiceLocator()->get('config');
    $storageDir = $config['xxx']['xxx']['xxx'];
    $mountCheckFile = $config['xxx']['xxx']['xxxx'];
    // we are using a simple file check as indication if we are mounted
    return touch($storageDir . DIRECTORY_SEPARATOR . $mountCheckFile);
}
该函数总是返回true,考虑如果我检查的文件是否存在。 我检查了路径,他们是正确的,我可以通过纳米通过schiell访问该文件。
触摸命令总是返回true,如果我删除或创建安装检查文件。
任何人有任何想法为什么?
我在用:
PHP 5.3.3-7 + squeeze19与Suhosin-Patch(cli)(内置:2014年2月17日上午10点10分23秒)
版权所有(c)1997-2009 The PHP Group
Zend Engine v2.3.0,版权所有(c)1998-2010 Zend Technologies
使用Xdebug v2.2.5,版权所有(c)2002-2014,Derick Rethans
Suhosin v0.9.32.1,版权所有(c)2007-2010,由SektionEins GmbH提供
OS:
经销商ID:Debian
描述:Debian GNU / Linux 6.0.3(squeeze)
版本:6.0.3
代号:挤压
  touch()是设置文件的访问和修改时间。 
  如果文件不存在,它将被创建。 
也许你可以像这样使用file_exists:
$filename = $storageDir . DIRECTORY_SEPARATOR . $mountCheckFile;
if (!file_exists($filename))
    return false;
return touch($filename);
