PHP 如何判断映射目录是否存在?
如果存在,如何获得此目录的大小和修改时间
目录为(\\apguds\note\x-section\05C62\) 开始运行中可直接打开
不知道PHP中代码对于这个路径是要怎么写的,试了半天没成功
如果存在,如何获得此目录的大小和修改时间
目录为(\\apguds\note\x-section\05C62\) 开始运行中可直接打开
不知道PHP中代码对于这个路径是要怎么写的,试了半天没成功
$location = "\\servername\sharename";
$user = "USERNAME";
$pass = "PASSWORD";
$letter = "Z";// Map the drive
system("net use ".$letter.": \"".$location."\" ".$pass." /user:".$user." /persistent:no>nul 2>&1");$dir = $letter.":/";// Check the directory
if(is_dir($dir) && is_readable($dir)) {
// 获取目录大小
}
<?php
// Define the parameters for the shell command
$location = "\\servername\sharename";
$letter = "Z";
// Map the drive
system("net use ".$letter.": \"".$location."\" /persistent:no>nul 2>&1");
$dir = $letter.":/";
// Check the directory
if(is_dir($dir) && is_readable($dir)) {
// 获取目录大小
}
<?php
// Define the parameters for the shell command
$location = "\\apguds02\mi_note\x-section\04c692";
$letter = "Z";
// Map the drive
system("net use ".$letter.": \"".$location."\" /persistent:no>nul 2>&1");
$dir = $letter.":/";
// Check the directory
if(is_dir($dir) && is_readable($dir)) {
echo '目录存在';
}
else{
echo '目录不存在';
}
?>这个目录是存在的,可是输出是不存在, 另外存在的时候如何获得大小和日期啊