Related to my previous post as I began to rewrite the existing code
I noted the directory exist and test path name are returning false
and failing to return 0 where I would expect them to succeed.
// Some quick code to test 'directory exists' and 'test path name'
$nativeRootPath := url to native path(get root) `This path should
definitely exist. Right?
write($nativeRootPath) `e.g., Mirrored RAID 3
Disk:Library:Application Support:4D:com.aparajita:Active4D:web:
// Split the path into its various folders
split string($nativeRootPath; directory separator; $pathParts)
a4d.debug.dump array($pathParts) `This outputs what I would expect
// Reassemble the folders and test :
// directory exists, and
// test path name
// at each step
$path := $pathParts{1}
for ($i; 2 ; size of array($pathParts) )
$path := $path + directory separator + $pathParts{$i}
$directoryExists := directory exists($path)
$result := test path name($path)
write("<p>")
write("\"" + $path + "\" " + $directoryExists + ": " + $result)
write("</p>")
end for
~~~~~
I'm not getting the expected results. Directory exists always
returns false and test path name returns -45 (File is locked).
Here is the output
Mirrored RAID 3 Disk:Library:Application
Support:4D:com.aparajita:Active4D:web:
[ I deleted the array dump in case the mailing list would block the
message ]
"Mirrored RAID 3 Disk:Library" False: -45
"Mirrored RAID 3 Disk:Library:Application Support" False: -45
"Mirrored RAID 3 Disk:Library:Application Support:4D" False: -45
"Mirrored RAID 3 Disk:Library:Application Support:4D:com.aparajita"
False: -45
"Mirrored RAID 3 Disk:Library:Application
Support:4D:com.aparajita:Active4D" False: -45
"Mirrored RAID 3 Disk:Library:Application
Support:4D:com.aparajita:Active4D:web" False: -45
~~~~~
Are my path inputs to directory exists in the wrong format?
File is locked seems like an odd response for test path name.
Active4D v5r19 running on 4D Remote on Mac OS X Server (10.6.4)
-- Brad
_______________________________________________
Active4D-dev mailing list
[email protected]
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/