Title:
DirectoryList sometimes errors on empty string for filter when using UNC paths
| View in TrackerStatus/Resolution/Reason: Closed/Fixed/
Reporter/Name(from Bugbase): Peter Boughton / Peter Boughton (Peter Boughton)
Created: 12/08/2014
Components: File Management
Versions: 11.0
Failure Type: Non Functioning
Found In Build/Fixed In Build: CF11_Final /
Priority/Frequency: Critical / All users will encounter
Locale/System: ALL / Win All
Vote Count: 1
This code was erroring:
var DiskQuery = DirectoryList
( Arguments.RootDir&Arguments.Location
, false
, "query"
, FilterGlob
, Arguments.Sort
, 'file'
);
Error message:
An error occurred when performing a file operation listFiles on file /path/to/directory.
The cause of this exception was: org.apache.commons.vfs2.FileSystemException: Could not find files in "file:////SERVER-L01/DFS-01/path/to/directory"..
After much debugging, it turns out the issue was FilterGlob being an empty string; hard-coding an empty string at this location gave the error.
Replacing the argument with the following made the code work:
len(FilterGlob)?FilterGlob:'*'
However, this code in another location - where the same argument is a hard-coded empty string - was not erroring:
var path = 'file://SERVER-L01/DFS-01/path/to/directory';
var DiskQuery = DirectoryList
( path
, false
, "query"
, ''
, 'type asc'
, 'file'
);
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3863993
External Customer Info:
External Company:
External Customer Name: boughtonp
External Customer Email:
External Test Config: My Hardware and Environment details:
Attachments:
Comments: