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: [EMAIL PROTECTED]

³I morti non sono piu soli ... The dead are no longer lonely²

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to