-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
file-lister.html
90 lines (90 loc) · 3.18 KB
/
file-lister.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<html>
<body>
<h2>
Filing System Utilities: File Lister
</h2>
<h3>What does this node do?</h3>
<p>
This node searches a folder (and optionally sub-folders) for files. optionally
may filter on a specific file and/or folder pattern.
</p>
<p>
The folder and files come from the computer and operating system that is
running Node-Red. AKA, the "host".
</p>
<h3>Outputs</h3>
<p>
By default, returns one message for each file found. The filename will be
in the msg.payload.
unless the <i>Output Single Message</i>
option is chosen.
</p>
<p>
If the <i>Output Single Message</i> option is chosen, the msg.payload will
contain an <i>array</i> of filenames.
</p>
<p>
Output filenames will contain the full file path if the <i>Full Path</i>
option is selected.
</p>
<p>
If the "Return file details" option is selected, each file output will be
an object. {"name":[filename], "stat": {"size":[fsize], ...}}
</p>
<h3>Inputs</h3>
<ul>
<li>
<b>Start Folder</b> [start] String containing the start folder location to search
for files. Without a leading '/', will search from the location the node
is installed which is not terribly useful so it is preferred to use
absolute paths. e.g. /home/pi<br />
Windows path names are also accepted. On Windows, you can use either form.
There is no need to escape backslashes.
Max path length is 1024
</li>
<li>
<b>File Pattern</b> [pattern] String that will be matched against the filenames.
Standard "glob" file patterns are allowed. Defaults to '*' which will return all files.
Max length is 1024
</li>
<li>
<b>Folder Pattern</b> [folders] String that will be matched against folder names.
Standard "glob" file patterns are allowed. Defaults to '*' which will match all
folders. Use the '!' to negate a folder - i.e. '!bin' means don't search the 'bin'
folder. Multiple patterns can be used so "*,!bin,!data" means 'search all subfolders
except 'bin' and 'data'. Max length is 1024
</li>
<li>
<b>Files/Folder/b> [lstype] Drop down that allows you to choice to return just files,
'folders or both
</li>
<li>
<b>Include hidden file/folders in output</b> Checkbox. If selected, hidden files
and folders will processed.
</li>
<li>
<b>Include full path in output</b> Checkbox. If selected (the default),
the output payload will have the folder path prepended to the filename.
</li>
<li>
<b>Output single message (array)</b> Checkbox. If selected, only one msg will be
sent; the msg.payload will contain an array of filenames.<br />
Otherwise, the default output is a single msg for each file found with
the msg.payload a string containing the filename.
</li>
<li>
<b>Max. search depth</b> Integer. Default 0 only searches the start folder.
Limits the depth of sub-folders that will be searched.
</li>
<li>
<b>Return file details</b> Checkbox. If selected, details of the files will be
returned as part of msg.payload
</li>
</ul>
<p>
To override the configured options, pass in a msg with msg.payload like:
<code>{"start":"/my/folder","pattern":"*.json"}</code>
Any missing options will be picked up from the configured node.
</p>
</body>
</html>