tracker issue : CF-3863993

select a category, or use search below
(searches all categories and all time range)
Title:

DirectoryList sometimes errors on empty string for filter when using UNC paths

| View in Tracker

Status/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

Listed in the version 2016.0.0.297996 Issues Fixed doc
Verification notes: verified_fixed on February 16, 2019 using build 2016.0.01.298513
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:

+1 ......................
Vote by External U.
9617 | January 06, 2015 02:00:22 AM GMT
There are 2 issues here: 1) directoryList() and <cfdirectory action="list"> fail for file:// paths when recurse=false and filter="" (or " ") 2) CF translates file://host to file:////host (I'll log a separate ticket for this) Steps to reproduce: 1) Create C:\ticketCF-3863993 and share it as ticketCF-3863993 2) Create C:\ticketCF-3863993\myfile.txt 3) Run the following code: <cfscript> //These fail writeDump(directoryExists("file://localhost/C:/ticketCF-3863993"));//Returns NO q = directoryList("file://localhost/ticketCF-3863993", false, "query", "");//Throws exception: Could not find files in "file:////localhost/ticketCF-3863993/" writeDump(q); q = directoryList("file:///C:/ticketCF-3863993", false, "query", "");//Throws exception: Could not find files in "file:///C:/ticketCF-3863993" writeDump(q); q = directoryList("file://localhost/C:/ticketCF-3863993", true, "query", "");//Throws exception: The specified directory file:////localhost/C:/ticketCF-3863993 does not exist. writeDump(q); q = directoryList("file://localhost/C:/ticketCF-3863993", false, "query", "");//Throws exception: The specified directory file:////localhost/C:/ticketCF-3863993 does not exist. writeDump(q); //These succeed writeDump(directoryExists("file:///C:/ticketCF-3863993"));//Returns YES q = directoryList("file://localhost/ticketCF-3863993", true, "query", ""); writeDump(q); q = directoryList("file:///C:/ticketCF-3863993", true, "query", ""); writeDump(q); </cfscript> <!--- These fail ---> <cfdirectory action="list" name="q" directory="file://localhost/ticketCF-3863993" recurse="no" filter=""><!--- Throws exception: Could not find files in "file:////localhost/ticketCF-3863993/" ---> <cfdump var="#q#"> <cfdirectory action="list" name="q" directory="file:///C:/ticketCF-3863993" recurse="no" filter=""><!--- Throws exception: Could not find files in "file:///C:/ticketCF-3863993" ---> <cfdump var="#q#"> <cfdirectory action="list" name="q" directory="file://localhost/C:/ticketCF-3863993" recurse="yes" filter=""> <cfdump var="#q#"><!--- Returns 0 results ---> <cfdirectory action="list" name="q" directory="file://localhost/C:/ticketCF-3863993" recurse="no" filter=""> <cfdump var="#q#"><!--- Returns 0 results ---> <!--- These succeed ---> <cfdirectory action="list" name="q" directory="file://localhost/ticketCF-3863993" recurse="yes" filter=""> <cfdump var="#q#"> <cfdirectory action="list" name="q" directory="file:///C:/ticketCF-3863993" recurse="yes" filter=""> <cfdump var="#q#">
Comment by External U.
9615 | January 06, 2015 02:01:18 AM GMT
Filed issue #2 (CF translates file://host to file:////host) as #CF-3916425. Thanks!, -Aaron
Comment by External U.
9616 | January 06, 2015 02:41:12 AM GMT
Hi Adobe, I've verified this is fixed in CF2016 Update 1 (build 2016.0.01.298513). Empty filter no longer triggers an exception. Thanks!, -Aaron
Comment by Aaron N.
30278 | February 16, 2019 06:56:28 AM GMT