tricky select filter

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
mikes16
Posts: 55
Joined: 02 Mar 2007 16:18

tricky select filter

Post by mikes16 »

Ok - this is a tricky one.

I play World of Warcraft. This online game allows you to use user modifications - bits of code people write. You put these bits of code in a directory - the directory structure of the bits of code is hierarchical - directories that contain both files, and other directories full of files.

I have downloaded a piece of software that scans this directory, and based on the content attempts to download any newer versions. There is a slight problem - sometimes the downloader "thinks" the current UI mod is the latest, and it isnt.

What I need is this - in a directory of files, delete everything below the first level of directories - leaving the top level undeleted. Here is a sample of the directory structure:

Code: Select all

<Top Level>
   - UI Mod #1 Dir
        - DIr1
             File1
        - Dir2
             File1
             FIle2
         -Files
   -UI Mod #2 DIr
        - DIr1
             File1
             FIle 67
        - Dir2
             File1
             FIle2
(formatting edited by don :wink: )

Etc. I want to "select" everything BELOW UI Mod #1 and #2 dirs, delete the content, but leave UI Mod #1 and #2 directories in tact (just empty). the downloader program will see these directory names, and not finding any content I am sure to get the entire package, fresh and with no overlap in old or useless files.

I can do this with other file managers. I would like to know if XYPlorer can do this.

If so - I have several different applications where i could use this at work. Let me tell you- in my previous file manager it was doable but VERY difficult and not easy to manage if a directory changed - if I changed directories up a bit it meant reconfiguring the search.

Thanks for the help.
-Files

admin
Site Admin
Posts: 60602
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: tricky select filter

Post by admin »

Well, maybe this is not about a select filter but about a new command "Empty (selected folders)"...

Or, if you don't mind when your subsubdirs ("Dir1" etc) survive, apply the select filter only to files, not to folders. I had the same thought some days ago, where this would have been quite useful for me...

mikes16
Posts: 55
Joined: 02 Mar 2007 16:18

Post by mikes16 »

I would rather the directories get deleted - but having only files deleted may serve my needs.

I like the fact that I can choose to ignore some folders - because there are some directories that I do not wish to empty. In this case there are UI modifications that are not controlled by the downloader program, and I want them skipped.

Take a look at the program Xplorer2 at http://zabkat.com/ It is nowhere near as good as XYPlorer, but its search mechanism is excellent. It is very flexible and provides an easy way to create search criteria that can be "AND" "OR" "NOT" etc. in a unique way. Perhaps looking at their search dialogs will spark something.

Thanks for the reply - I am really enjoying your product.

admin
Site Admin
Posts: 60602
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Post by admin »

Well, XY's support for Boolean logic is unrivaled on this planet. Can't you create a search template that serves your needs?

mikes16
Posts: 55
Joined: 02 Mar 2007 16:18

Post by mikes16 »

admin wrote:Well, XY's support for Boolean logic is unrivaled on this planet. Can't you create a search template that serves your needs?
To the Wiki I go! I will figure it out!

jacky
XYwiki Master
Posts: 3106
Joined: 23 Aug 2005 22:25
Location: France
Contact:

Post by jacky »

hmm.. okay here's a "new idea" to approach your problem here, which is how I would do it, and I think might be easier than dealing with searches (but I might be wrong!)

You only wanna keep the "UI Mod #n" dir right? so here's how I would do it:
- under <Top Level> create a new folder "tmp"
- select all the "UI Mod #n" folders you wanna "empty", then right drag&drop them onto the newly created "tmp" and choose "Create Folder(s) Here" -- this will have XY recreate those folders, empty.
- Still under <Top Level>, all the "UI Mod #n" folders are still selected: hit Del and delete them!
- No move all the subfolders of "tmp" back into <Top Level> and delete the now empty "tmp"

> you now have all your "UI MOD #n" folders empty! :)
And of course, you could select only the folders you want, so you can "ignore" some to let them "untouched"/not have them be emptied.

Hope this can help!

ps: if you don't get the "Create Folder(s) Here" on the right D&D ctxt menu, you probably need to enable a great (and must-have, IMO) XY feature under Configuration/Advanced: Custom drag'n'drop context menu
Proud XYplorer Fanatic

mikes16
Posts: 55
Joined: 02 Mar 2007 16:18

Post by mikes16 »

Thanks for the idea Jacky - that seems to work - although not very "elegant" - but gets the job done.

I can also target certain file types, and delete all of the files. I am currently working on this as a project now, just to see if it is possible. I figure the way to do it is via two templates - one to target the files, one for the directories.

The trouble I am having is matching the correct directories. In other tools I have used what I did was the following "!\*;\*\*" which said do not match the directories at the root, but target everything below that first level of directories.

Now, I know XYplorer is not that other program (it is better) and I only make these references not to diminish XYplorer but to help frame the function. Just thought I would throw that in - I am a XYplorer convert and am just starting to make my way through the tool :)

That being said - "!\*;\*\*" is not cutting the mustard - and in actuality the program that it "DOES" work in is probably "broken" in that I don't think it is a correct result, but - it worked.

Assuming I can create a template to get the directories selected correctly my next request will be to allow XYplorer to AND two templates together :) and run them both.

jacky
XYwiki Master
Posts: 3106
Joined: 23 Aug 2005 22:25
Location: France
Contact:

Post by jacky »

hmm well yeah actually there's a very easy search to do what you want, assuming your <Top Level> folder is called "TopLevel" then do this:
Search for: *\\TopLevel\\*\\*
(yes, the backspace must be escaped!) and don't forget to enabled option "Check full path"

Then XY will check your pattern not against the item's names but their full path, and only get as results those that are in a subfolder of "TopLevel". So deleting all the search results means that no files or folders from "TopLevel" will be deleted, but everything else will be, namely all folders & files within subfolders of "TopLevel"; which is what you're trying to do I beleive.

I tried this quickly, it works but there's a problem (might not be coming from XY but from Windows actually...) : select all & delete files got me errors because not every files are in the same folder, and the shell got confused.
So I had to hit "Ok", then Del again, and so on untill everythig was gone. A bit annoying, but it happended and other ocasions and turns out it is a bug in Windows which can't handle such operations right!
And somehow I have a feeling that won't even have been fixed in Vista, but hey you got 3D effects, can't have it all! :P Here's one more to dreaming that XY would actually handle all file operations itself and not rely on buggy Windows 8)
Proud XYplorer Fanatic

mikes16
Posts: 55
Joined: 02 Mar 2007 16:18

Post by mikes16 »

Jacky - this is fantastic - bugs aside. I am wondering if Don could try deleting from the pane to validate if these are windows errors or something that can be fixed in XYplorer.

Thank you so much - this is SO elegant and easy.

admin
Site Admin
Posts: 60602
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Post by admin »

jacky wrote:I tried this quickly, it works but there's a problem ...
Yep, kind of a bug.

Take today's fix log as explanation:

Code: Select all

    ! Now multiple items to be deleted or moved are backward-sorted 
      before the job, to avoid that an item is first deleted along with 
      its containing folder and then individually again when it's gone 
      already which would raise a shell error "file not found...".
Sorting backwards guarantees that the contents are handled before their containers.

You could call this a Windows bug, too, because if Windows would be clever it would do that internal sorting itself, and not try to delete the contents after it just deleted the container.

Anyway, it is handled now. Once again XYplorer works around Windows. :wink:

mikes16
Posts: 55
Joined: 02 Mar 2007 16:18

Post by mikes16 »

Simply - well what can I say - awesome support. Wow.

I work for a large software corporation and we are so big many of us have forgotten how to support our customers. The machinery in place in this juggernaut of a company is so inhibiting - fixes take 6 months +, features a year or more!

Thanks again for an excellent product and superb support.

admin
Site Admin
Posts: 60602
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Post by admin »

mikes16 wrote:I work for a large software corporation...
May they buy XY! :)

mikes16
Posts: 55
Joined: 02 Mar 2007 16:18

Post by mikes16 »

I can only hope. I definitely will promote this internally. There are 2 applications I talk about - this one and truelaunchbar at http://www.truelaunchbar.com. The developer there is also very responsive to his customers. His product has a lot of features I do not use, but what I do use is a real time saver. I hit the "WIN+x" key and a little menu pops up at my cursor containing shortcuts to my favorite programs (xyplorer of course), url links, documents - anything I want - and when I click on an item in that menu the menu disappears from view. It is just a great product, and well supported, and just wanted to mention it. It has increased my productivity at the keyboard almost as much as having a file manager replacement.

Post Reply