Skip to main content

bugs - A documented syntax of FileNames doesn't work?



Documentation discrepancy present in 10.3 and fixed in 10.4.1




According to the documentation for FileNames under Details:


FileNames[forms,dirs,{n}] includes names of directories only if they appear exactly at level n.


However when I attempt to use this syntax I get an error:


FileNames["foo*", "c:\\", {2}]


FileNames::innf: Non-negative integer or Infinity expected at position 3 in FileNames[foo*,c:\,{2}]. >>




I am using Mathematica 10.0.1 under Windows. Does this syntax work on other systems?



Answer



It was fixed in 10.4.1


Posting this wiki answer to reduce the unanswered questions stack


FileNames["D*", $InstallationDirectory, {2}]


{"C:\\Program Files\\Wolfram Research\\Mathematica\\10.4\\SystemFiles\\Data", 
"C:\\Program Files\\Wolfram Research\\Mathematica\\10.4\\SystemFiles\\Devices",
"C:\\Program Files\\Wolfram Research\\Mathematica\\10.4\\SystemFiles\\Dictionaries"}


Comments