ArneBachmann / tagsplorer

A quick and resource-efficient OS-independent tagging filetree extension tool and library
Mozilla Public License 2.0
3 stars 1 forks source link

Finding files called a in folders called a #69

Closed ArneBachmann closed 3 years ago

ArneBachmann commented 7 years ago

Is this currently possible? What would break if we handled the "remaining" tags differently?

ArneBachmann commented 7 years ago

The misconception here is that tags find folders. Yes, findFolders returns a list of paths, but this is only a superset of paths for potential files to find. The problem comes with globs: ab*.?pp might mean all C++ source and header files of a certain glob, but could also mean a folder name, of which we would like to see all files. But latter is basically also returning a folder, but removing the tag from the findFiles remaining poss list. But when looking for an extension like .?pp we get a narrowed down list of paths, in which we still have to filter by the extension. How can we distinguish? We need a semantic decision here. The problem comes from the fact, that also folders may have an extension, but our assumption so far was that extensions demark files.

ArneBachmann commented 7 years ago

Currently all positive search terms are removed in findFiles, if they are found in the path's constituents. This would be the place to remove them as well, if we decide on a semantics.

ArneBachmann commented 7 years ago

Implemented above comment. One further idea would be to allow duplicate search terms meaning "folder and file name alike". Alternative would be different options like -s -x for folders and -sf -xf for files. Opened issue #77.