Number of files in a folder
Re: Number of files in a folder
How do I apply a red label ?
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
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 : "");