# 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:

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?

• I have exactly the same error message with both MMA 10.0.1.0 and MMA 9.0.1.0, on OS X 10.9.4 (when I input for example FileNames["foo*", "/", {2}]) Also in MMA 9.0.1.0 Documentation, the curly brackets are missing : !enter image description here – SquareOne Sep 24 '14 at 8:37
• Maybe they have a documentation driven development at WRI. They first write the doc and then implement the stuff and some guy went home early :-) – halirutan Sep 24 '14 at 8:55
• @Mr.Wizard It was meant only half as joke. I was referring to test-driven development which is similar only that you write unit tests for components that don't exist yet. Then you hit random keys until you come up with code that fulfills the test.. – halirutan Sep 24 '14 at 14:50
• @Mr.Wizard So I got a reply that is was already reported. – Kuba Mar 5 '15 at 19:03
• Persistent in 10.2. – rcollyer Jul 15 '15 at 12:58

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

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

• FileNames["foo*", "c:\\", {2}] cannot run normally still. – yode Dec 8 '16 at 14:45