Page 2 of 2

Re: Number of files in a folder

Posted: 24 Jul 2021 11:58
by zakoul
How do I apply a red label ?

Re: Number of files in a folder

Posted: 24 Jul 2021 12:00
by highend
tag / tagitems()

Maybe reading the help file would... help?

Re: Number of files in a folder

Posted: 24 Jul 2021 16:41
by zakoul

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  : "");
it was difficult for me