es.exe filter on "hard link count" or other properties?

If you are experiencing problems with "Everything", post here for assistance.
Post Reply
jimspoon
Posts: 187
Joined: Tue Apr 26, 2011 11:39 pm

es.exe filter on "hard link count" or other properties?

Post by jimspoon »

My specific use case - Thunderbird allows for emails to be stored in "maildir" format, i.e. individual files for each email with an .eml extension. But to be used in Thunderbird, the .eml files must be located in folders in the Thunderbird profile folder. The names that Thunderbird gives to these .eml files are not very meaningful to me. So my idea is to make hard links to these .eml files, rename the the hardlink files to be more meaningful to me, and move them to other locations on the same volume. My idea is to use Everything to identify the .eml files that don't have hard links to them yet, and then create them.

I know I can use the Everything GUI to display a "Hard Link Count" column, and this would show .emls with a Hard Link Count of 1 (the original directory entry). However, to automate things, I'd like to use es.exe to generate a collection of files with hardlinkcount=1 and feed that in Powershell pipeline for further processing.

Is there a way to use es.exe to do this? It seems not yet - from a recent post by Void it seems that es.exe support for search by property values is on the todo list.

Meanwhile it does seem that pseverything might work for my purpose - i can generate a list of files with a command as follows:
search-everything *.eml -filter hard-link-count:=1
I'm hoping that it produces not just text output, but a collection of fileinfo objects with their associated properties and methods to facilitate processing in Powershell.

It would be great if es.exe output could also be in the form of objects.
void
Developer
Posts: 16680
Joined: Fri Oct 16, 2009 11:31 pm

Re: es.exe filter on "hard link count" or other properties?

Post by void »

Not yet, sorry.

Property support for es is on my TODO list.

I will look into an option to output as a powershell object.

Thank you for the suggestions.
horst.epp
Posts: 1443
Joined: Fri Apr 04, 2014 3:24 pm

Re: es.exe filter on "hard link count" or other properties?

Post by horst.epp »

I also use the MailDir format since many years.
To quickly find mails, I let Everything index the content of the Thunderbird eml files.
NotNull
Posts: 5458
Joined: Wed May 24, 2017 9:22 pm

Re: es.exe filter on "hard link count" or other properties?

Post by NotNull »

jimspoon wrote: Sat Jul 22, 2023 12:30 am s there a way to use es.exe to do this? It seems not yet - from a recent post by Void it seems that es.exe support for search by property values is on the todo list.
You should be able to use ES.exe for properties too. The limitation is in the output: showing the value of various Property columns, like the actual hardlink count number.
You can still search for properties (input).

So this will work in PowerShell (example):

Code: Select all

PS T:\> es.exe ext:exe everything.exe hardlinkcount:2
C:\Program Files\Everything 1.5a\Everything.exe
PS T:\>

(I created a hardlink Everything.exe to Everything64.exe for convenience)



To convert textual filenames to objects:

Code: Select all

es.exe ext:exe everything.exe hardlinkcount:2 | Get-Item
Get-Item can be shortened to gi

Converting text to PowerShell objects is not something Everything should take care of as it is quite complex (in my opinion).
jimspoon
Posts: 187
Joined: Tue Apr 26, 2011 11:39 pm

Re: es.exe filter on "hard link count" or other properties?

Post by jimspoon »

Thanks Notnull, that's very helpful. On the subject of getting objects to put into the Powershell pipeline, I remembered I had seen a video about a new way to do that. I found it and it's called Crescendo ( https://github.com/PowerShell/Crescendo ):
Crescendo is a development accelerator enabling you to rapidly build PowerShell cmdlets that leverage existing command-line tools. Crescendo amplifies the command-line experience of the original tool to include object output for the PowerShell pipeline, privilege elevation, and integrated help information. A Crescendo module replaces cumbersome command-line tools with PowerShell cmdlets that are easier to use in automation and packaged to share with team members.
NotNull
Posts: 5458
Joined: Wed May 24, 2017 9:22 pm

Re: es.exe filter on "hard link count" or other properties?

Post by NotNull »

jimspoon wrote: Sun Jul 23, 2023 1:54 amCrescendo
Interesting, thank you1


Regarding the complexity of converting to file objects:
Everything/ ES can report files that are currently unavailable (on removable disks, for example); it wouyld be complex to convert these non-existing files -- from the viewpoint of the operating system -- to a file object. Might even be impossible.
Post Reply