Number of files in a folder
-
zakoul
- Posts: 156
- Joined: 11 Dec 2019 10:44
-
highend
- Posts: 15016
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: Number of files in a folder
tag / tagitems()
Maybe reading the help file would... help?
Maybe reading the help file would... help?
One of my scripts helped you out? Please donate via Paypal
-
zakoul
- Posts: 156
- Joined: 11 Dec 2019 10:44
Re: Number of files in a folder
Code: Select all
$hardlinks = property("#hardlinks", <cc_item>);
if ($hardlinks > 1) { return $hardlinks; }
$files = listfolder(<cc_item>, , 1, <crlf>);
$cntFiles = 0;
foreach($file, $files, <crlf>, "e") {
if (property("#HardLinks", $file) > 1) { $cntFiles++; }
}
$allFiles = gettoken($files, "count", <crlf>);
if ( $cntFiles > 0 && $cntFiles == $allFiles) { tag 1, <cc_item> }
else { tag 0, <cc_item> }
return ($cntFiles ? $cntFiles . "/" . $allFiles : "");Windows 11 25H2, 100%
XYplorer Beta Club