prop:#HardLinks:>1
?Number of files in a folder
Number of files in a folder
Is it possible to create a column that would display the number of files in a folder with a property
Re: Number of files in a folder
Use a custom column with a script?
Code: Select all
$hardlinks = property("#hardlinks", <cc_item>);
if ($hardlinks > 1) { return $hardlinks; }
return "";
One of my scripts helped you out? Please donate via Paypal
Re: Number of files in a folder
Yes. Does the script only work for files?
Can I do it for folders?
To display the number of files in the folder.
Can I do it for folders?
To display the number of files in the folder.
Re: Number of files in a folder
There is no such thing as a hard link to a directory in Windows.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3447)
Portable XYplorer (actual version, including betas)
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.73
Portable XYplorer (actual version, including betas)
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.73
Re: Number of files in a folder
The script should count how many hardlinked files are in each folder.
Re: Number of files in a folder
Recursively?The script should count how many hardlinked files are in each folder
One of my scripts helped you out? Please donate via Paypal
Re: Number of files in a folder
I do not know
Last edited by zakoul on 22 Jul 2021 11:02, edited 1 time in total.
Re: Number of files in a folder
Code: Select all
$files = listfolder(<cc_item>, , 1, <crlf>);
$cntFiles = 0;
foreach($file, $files, <crlf>, "e") {
if (property("#HardLinks", $file) > 1) { $cntFiles++; }
}
return $cntFiles;
One of my scripts helped you out? Please donate via Paypal
Re: Number of files in a folder
Thanks.
Is it possible to hide zero results and indicate the total number of files after "/"?
For example 13/65 (13-hardlink>1 / 65-all files in folder).
Is it possible to hide zero results and indicate the total number of files after "/"?
For example 13/65 (13-hardlink>1 / 65-all files in folder).
Re: Number of files in a folder
That is no rocket science...
Code: Select all
$files = listfolder(<cc_item>, , 1, <crlf>);
$cntFiles = 0;
foreach($file, $files, <crlf>, "e") {
if (property("#HardLinks", $file) > 1) { $cntFiles++; }
}
return ($cntFiles ? $cntFiles . "/" . gettoken($files, "count", <crlf>) : "");
One of my scripts helped you out? Please donate via Paypal
Re: Number of files in a folder
Thanks. Exactly what is needed.
Re: Number of files in a folder
Can I add that the number of hard links is also displayed for the files in the same custom column?
How's that? Will the results be displayed faster?
Last edited by zakoul on 22 Jul 2021 14:44, edited 1 time in total.
Re: Number of files in a folder
2nd post and then combine that stuff...
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++; }
}
return ($cntFiles ? $cntFiles . "/" . gettoken($files, "count", <crlf>) : "");
And how can you change the color where 100% hits?
So that the color of the text in such cases is displayed in red.
Re: Number of files in a folder
Custom column text doesn't support colorization, maybe assign a label...
One of my scripts helped you out? Please donate via Paypal