Smart Folders (Finder -> File -> New Smart Folder). It's not exactly hidden but I never paid too much attention to it. It's essentially a way to create a folder whose content is dynamically updated based on your search conditions.
For example, you can create a smart folder that contains all PDF files matching a certain name pattern within a given directory (or the whole disk) [0]. You can get really advanced, there's a ton of different parameters you can use [1], and you can even create more complicated conditions by holding Option and clicking the plus sign (now changed to just three dots). And of course you can drag these folders into the sidebar's Favourites section.
I’ve been sad since they were introduced that they don’t work at the file system level, hence not in CLI applications. Support for them in desktop apps that open directories is also spotty.
I would LOVE them if they were reimplemented as a fuse style file system instead of a userland macOS trick.
I wonder if there is a list somewhere around Apple of "Annoying Edge Cases We'd Have To Support If Smart Folders Worked At The Filesystem Level", and how long it is.
Like, you're in a smart folder that contains files whose name includes "foo", and you try to create a file whose name does not include "foo", what happens? Do you get an existing filesystem error? Do you get a new "can't create new files in smart folders" error?
Interestingly enough I just discovered that if you drag a file into the Tags section of the Finder window's sidebar, it will remain where it is - but if you create a smart folder whose criteria is "tag:tagname" it won't let you drag anything into it, even though it shows the exact same set of files.
Presumably a "smart directory" would itself be read-only, as if mounted from an ROFS; but its contents would all be symbolic links, such that when you're opening the file, you're opening its readlink(2) target, so the fact that the source link was read-only doesn't matter to your ability to modify the file.
This would pretty much match the expectations of how "Smart Folders" currently work in the Finder, and also how equivalents like "Smart Playlists" work in iTunes/Music.
Ooh, good one. Not a problem when it’s GUI-only, with the little display of the precise path at the bottom when you click it, but disambiguating this for CLI use requires a whole new approach.
That's not the point. I have no doubt that the people at Apple are able to solve these issues. I think a lot of people on HN are able to propose solutions to many of these issues.
The point OP was making is that they have probably did their due diligence and subsequently decided that it ain't worth doing.
Oh for sure. I also imagine it depends on which team proposed it. If it’s the Finder team it might not occur to them to offload it to the file system team because it’s a fancy add on, not a system level thing. I have never used this feature but might give it a go. Having all the PDF files in one place could actually be fairly useful. Could also be nice to combine this with my Dropbox photography workflow.
I think it would be relatively easy to write a MacFUSE driver that uses the mdfind APIs to provide a fake directory of symlinks to the actual files. I might give it a shot. Sounds like a nice side project.
"hence not in CLI applications" is that specific aspect accurate? I'm no longer mac user but thought mdfind (https://ss64.com/osx/mdfind.html) was the command line version of what smart folders use. Not the same as a filesystem but usable for many CLI apps.
I exclusively used smart playlists for my ipod nano (for date reference :), I pray that one day these smart folders appear on win/osx as a low level. Like smart symbolic links. Surely it cant be that hard!
I think so. Just create a new Smart Folder, set the condition to something that matches all files, for example "Created is after 1970" and sort by "Date Created".
Other way around. Smart playlists (iTunes 3; July 17, 2002) came long before smart folders (MacOS X 10.4 "Tiger"; April 29, 2005), and solve a simpler problem due to dealing with a single file type and a pre-existing existing centralized database of standardized and relatively homogeneous ID3 metadata. Spotlight was created to extensibly generalize these capabilities to the while filesystem.
For example, you can create a smart folder that contains all PDF files matching a certain name pattern within a given directory (or the whole disk) [0]. You can get really advanced, there's a ton of different parameters you can use [1], and you can even create more complicated conditions by holding Option and clicking the plus sign (now changed to just three dots). And of course you can drag these folders into the sidebar's Favourites section.
[0] https://i.imgur.com/lD2zaSd.png
[1] https://i.imgur.com/SKsQRnQ.png