Group Abstract Group Abstract

Message Boards Message Boards

0
|
3.7K Views
|
2 Replies
|
1 Total Like
View groups...
Share
Share this post:

[?] Set directories on FileNames?

In the documentation of the FileNames function I find that to search for a type of file at an arbitrary depth you can use:

FileNames[forms,dirs,Infinity]

However, it is not said how to input "dirs". I have tried different ways of doing it, without success.

Can somebody help me? PS. Instead of Infinity I can plug in any depth, right? Say {1} or {10}

2 Replies
Posted 7 years ago

What exactly have you tried?

$HomeDirectory
(* /Users/rohit *)

FileNames["*.nb", $HomeDirectory, 2] (* Notebook files in levels 1 & 2 *)
FileNames["*.nb", $HomeDirectory, {2}] (* Notebook files in level {2} only *)
POSTED BY: Rohit Namjoshi

Many thanks, you solved my problem!

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard