Status/Resolution/Reason: Closed/Withdrawn/NotABug
Reporter/Name(from Bugbase): Peter Freitag / Peter Freitag (Peter Freitag)
Created: 02/10/2016
Components: File Management
Versions: 11.0
Failure Type: Enhancement Request
Found In Build/Fixed In Build: CF11_Final /
Priority/Frequency: Trivial / Unknown
Locale/System: English / Mac 10 All
Vote Count: 3
Currently if you want to determine if a path is pointing to a file or a directory you need to use the getFileInfo function and look at the type key of the struct returned. The getFileInfo function throws an exception if the path does not exist, so you then need to check both directoryExists(path) OR fileExists(path) before you can use the getFileInfo() function for this purpose.
Further getFileInfo returns a lot of information that is not necessary for this use case.
I purpose adding two new builtin functions:
isFile(path) which would be equivalent to: fileExists(path) && getFileInfo(path).type == "file" or createObject("java", "java.io.File").init(path).isFile()
isDirectory(path) which would be equivalent to: directoryExists(path) && getFileInfo(path).type == "directory" or createObject("java", "java.io.File").init(path).isDirectory()
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 4116201
External Customer Info:
External Company:
External Customer Name: Peter Freitag
External Customer Email:
External Test Config: My Hardware and Environment details: Mac
Attachments:
Comments: