Re: RE: Cannot access file on Network Drive (Windows 2003)
| From: | Rahul Sitaram Johari | Date: | Thu, 24 May 2007 14:35:58 +0000 |
| Subject: | Re: RE: Cannot access file on Network Drive (Windows 2003) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-255535@lists.php.net to get a copy of this message | ||
Ave,
Instead of going back & forth on various function & path tests, I wrote a
small code containing different suggested combinations of PATH and also the
gettype() as Jim had requested. Following is the Code and the Output.
Code:
$filename = 'X:\send\Transfer\LIVE\live.txt';
echo gettype($filename)."<br>";
if (file_exists($filename)) {
echo "The file $filename Exists<br>";
} else {
echo "The file $filename does NOT Exist<br><br>";
}
$filename1 = 'X:\\send\\Transfer\\LIVE\\live.txt';
echo gettype($filename1)."<br>";
if (file_exists($filename1)) {
echo "The file $filename1 Exists<br>";
} else {
echo "The file $filename1 does NOT Exist<br><br>";
}
$filename2 = 'X:/send/Transfer/LIVE/live.txt';
echo gettype($filename2)."<br>";
if (file_exists($filename2)) {
echo "The file $filename2 Exists<br>";
} else {
echo "The file $filename2 does NOT Exist<br><br>";
}
$filename3 = 'X://send//Transfer//LIVE//live.txt';
echo gettype($filename3)."<br>";
if (file_exists($filename3)) {
echo "The file $filename3 Exists<br>";
} else {
echo "The file $filename3 does NOT Exist<br><br>";
}
$filename4 = '\\Foresight\send\Transfer\LIVE\live.txt';
echo gettype($filename4)."<br>";
if (file_exists($filename4)) {
echo "The file $filename4 Exists<br>";
} else {
echo "The file $filename4 does NOT Exist<br><br>";
}
$filename5 = '\\\\Foresight\\send\\Transfer\\LIVE\\live.txt';
echo gettype($filename5)."<br>";
if (file_exists($filename5)) {
echo "The file $filename5 Exists<br>";
} else {
echo "The file $filename5 does NOT Exist<br><br>";
}
$filename6 = '//Foresight/send/Transfer/LIVE/live.txt';
echo gettype($filename6)."<br>";
if (file_exists($filename6)) {
echo "The file $filename6 Exists<br>";
} else {
echo "The file $filename6 does NOT Exist<br><br>";
}
$filename7 = '////Foresight//send//Transfer//LIVE//live.txt';
echo gettype($filename7)."<br>";
if (file_exists($filename7)) {
echo "The file $filename7 Exists<br>";
} else {
echo "The file $filename7 does NOT Exist<br><br>";
}
Output:
string
The file X:\send\Transfer\LIVE\live.txt does NOT Exist
string
The file X:\send\Transfer\LIVE\live.txt does NOT Exist
string
The file X:/send/Transfer/LIVE/live.txt does NOT Exist
string
The file X://send//Transfer//LIVE//live.txt does NOT Exist
string
The file \Foresight\send\Transfer\LIVE\live.txt does NOT Exist
string
The file \\Foresight\send\Transfer\LIVE\live.txt does NOT Exist
string
The file //Foresight/send/Transfer/LIVE/live.txt does NOT Exist
string
The file ////Foresight//send//Transfer//LIVE//live.txt does NOT Exist
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Rahul Sitaram Johari
CEO, Twenty Four Seventy Nine Inc.
W: http://www.rahulsjohari.com
E: sleepwalker@rahulsjohari.com
³I morti non sono piu soli ... The dead are no longer lonely²