Status/Resolution/Reason: Closed/Fixed/Fixed
Reporter/Name(from Bugbase): Aaron Neff / Aaron Neff ()
Created: 06/10/2017
Components: Net Protocols, FTP
Versions: 2016,11.0
Failure Type: Incorrectly functioning
Found In Build/Fixed In Build: 2016.0.01.298513 / 303850
Priority/Frequency: Major / Some users will encounter
Locale/System: / Win 2012 Server x64
Vote Count: 0
cfftp's existsfile treats populated directory as file
Repro:
<cfscript>
myServer = "localhost";
myUsername = "mysitecomwww";
myPassword = "password";
myDir = "foo";
if(directoryExists(expandPath(myDir))) {
directoryDelete(expandPath(myDir), true);
}
directoryCreate(expandPath(myDir));
cfftp(action="existsfile", remoteFile=myDir, result="r", server=myServer, username=myUsername, password=myPassword);
writeOutput(r.returnValue);//returns False (good - b/c myDir isn't a file) (note: Actually, existsfile should return YES/NO instead of True/False - will log another bug)
directoryCreate(expandPath(myDir & '/bar'));
cfftp(action="existsfile", remoteFile=myDir, result="r", server=myServer, username=myUsername, password=myPassword);
writeOutput(r.returnValue);//returns True (bug - b/c myDir isn't a file)
directoryDelete(expandPath(myDir & '/bar'));
cfftp(action="existsfile", remoteFile=myDir, result="r", server=myServer, username=myUsername, password=myPassword);
writeOutput(r.returnValue);//returns False (good - b/c myDir isn't a file)
fileWrite(expandPath(myDir & '/foo.txt'), "foobar");
cfftp(action="existsfile", remoteFile=myDir, result="r", server=myServer, username=myUsername, password=myPassword);
writeOutput(r.returnValue);//returns True (bug - b/c myDir isn't a file)
fileDelete(expandPath(myDir & '/foo.txt'));
cfftp(action="existsfile", remoteFile=myDir, result="r", server=myServer, username=myUsername, password=myPassword);
writeOutput(r.returnValue);//returns False (good - b/c myDir isn't a file)
</cfscript>
Actual result: "FalseTrueFalseTrueFalse"
Expected result: "NONONONONO"
Attachments:
Comments: