How can I make a filter only show files(exclude dirs)?

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
vinsapro
Junior Member
Junior Member
Posts: 5
Joined: 2005-10-19, 15:35 UTC

How can I make a filter only show files(exclude dirs)?

Post by *vinsapro »

Hi,all,

Once I press Ctrl+F12, a dialog shown and we can make a filter to filte the file list. but, how can I make a filter which only show files not directories?

Thank you.
User avatar
Gral
Power Member
Power Member
Posts: 1467
Joined: 2005-01-26, 15:12 UTC

Post by *Gral »

You cannot.
User avatar
Lefteous
Power Member
Power Member
Posts: 9535
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

2vinsapro
Once I press Ctrl+F12, a dialog shown and we can make a filter to filte the file list. but, how can I make a filter which only show files not directories?
You can do this in a two step procedure. First apply the desired filter to select the files to show then show only selected files.
vinsapro
Junior Member
Junior Member
Posts: 5
Joined: 2005-10-19, 15:35 UTC

Post by *vinsapro »

great! Many thanks!

and then, can I do these steps in one script?
User avatar
Vochomurka
Power Member
Power Member
Posts: 814
Joined: 2005-09-14, 22:19 UTC
Location: Russia
Contact:

Post by *Vochomurka »

Yes, you easily can, using PowerPro scripts
Single user license #329241
PowerPro scripts for Total Commander
jjk
Member
Member
Posts: 181
Joined: 2003-07-03, 10:41 UTC

Post by *jjk »

To Lefteous
You can do this in a two step procedure. First apply the desired filter to select the files to show then show only selected files.
I've created a filter "OnlyDirs" that selects only directories. It works fine for colours. But when Ctrl-F12 >OnlyDirs nothing happens. All files and dirs are shown, nothing is hidden. What is wrong ?
User avatar
karlchen
Power Member
Power Member
Posts: 4603
Joined: 2003-02-06, 22:23 UTC
Location: Germany

Post by *karlchen »

Hi, jjk.

Something must be wrong with your filter definition.

I suggest you proceed like this:
+ Open your wincmd.ini
+ Locate the [Search] section
+ Inside it locate your "DirsOnly" filter.

Compare it to mine. There must be a difference. My filter works fine.

Code: Select all

DirsOnly_SearchFor=*.*
DirsOnly_SearchIn=.
DirsOnly_SearchText=
DirsOnly_SearchFlags=0|000002000020||||||||22221|0000
The 1 inside the string 22221 decides that the D attribute must be set. Only folders have it.

Karl
MX Linux 21.3 64-bit xfce, Total Commander 10.52 64-bit
The people of Alderaan keep on bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine.
The Prophet's Song
User avatar
Lefteous
Power Member
Power Member
Posts: 9535
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

2jjk
What is wrong ?
Did you execute "show only selected" as written above?
User avatar
karlchen
Power Member
Power Member
Posts: 4603
Joined: 2003-02-06, 22:23 UTC
Location: Germany

Post by *karlchen »

Hi, Lefteous.

For the OnlyDirs filter it is not necessary to take the second step and select "Only selected files".

Show => Custom => >OnlyDirs is enough, because only folders have got the D attribute (D=directory, from the good old times when folders were still called directories).

You may have missed that jjk is trying to achieve the exact opposite of the thread title:
jjk wrote:I've created a filter "OnlyDirs" that selects only directories.
--
P.S.:
Interesting phenomenon:

When I created this "OnlyDirs" filter, it would only work, if I created it inside the "Search => Find files" dialogue (Alt-F7), but not if I created it inside "Show => Custom => Custom" dialogue.
I tried this several times and could reproduce this (mis)behaviour on WinXP Prof Sp1, TC 6.54a.

Karl
MX Linux 21.3 64-bit xfce, Total Commander 10.52 64-bit
The people of Alderaan keep on bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine.
The Prophet's Song
User avatar
Lefteous
Power Member
Power Member
Posts: 9535
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

2karlchen
Ah ok - I didn't see someone inverted the topic :?
But why he asked me why my solution to another problem doesn't work :o
jjk
Member
Member
Posts: 181
Joined: 2003-07-03, 10:41 UTC

Post by *jjk »

Sorry and apologizes :oops:
I've created a filter "OnlyDirs" that selects only directories. It works fine for colours. But when Ctrl-F12 >OnlyDirs nothing happens. All files and dirs are shown, nothing is hidden.
I meaned the exact opposite :
I've created a filter "OnlyFiles" that selects only files. It works fine for colours. But when Ctrl-F12 >OnlyFiles nothing happens. All files and dirs are shown, nothing is hidden.
Effectively, for "OnlyDirs", only the dirs are shown, and files are hidden. It works fine.
But with OnlyFiles dirs are still shown (and files also of course).

Thx for your reply, but I ask you for a second answer please.
User avatar
Lefteous
Power Member
Power Member
Posts: 9535
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

2jjk
Sorry and apologizes
No problem :)

The idea is to select all files first (Num+ instead of Ctrl+F12). After selecting the files perform the command "Only Selected files" in the show menu.
Post Reply