How to sort folders by type of files inside

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
zaikar
Junior Member
Junior Member
Posts: 4
Joined: 2011-10-26, 16:04 UTC
Location: España

How to sort folders by type of files inside

Post by *zaikar »

Hi,

Let me explain. I've got a bunch of folders each one with different files in them, some of them with photos, movies etc. and some of the with onlya a "rar" or a "zip", so I'd love to be able to only see those with "X" type of flie, in my case I'd love to keep the ones with "rar and zip". Is there any way to do that?

MANY MANY THANKS
User avatar
ZoSTeR
Power Member
Power Member
Posts: 1052
Joined: 2004-07-29, 11:00 UTC

Post by *ZoSTeR »

It depends on what you are really planning to do.
I don't think there's a function or plugin specifically for this.
What if the folder contains multiple file types?
How should they be sorted?

If you want to move all zip or rar files and keep them in their folders you can use CopyTree.
Just search for .zip or use Ctrl+B to get the file list and "pack" them with CopyTree.

Another option would be to write a script to count the files with a specific extension and write the result to the descript.ion file of the folder.
zaikar
Junior Member
Junior Member
Posts: 4
Joined: 2011-10-26, 16:04 UTC
Location: España

Post by *zaikar »

Thanks for the answer!.

Well, my idea was to only show the folders that contain "X" files meaning that I can choose to see only the folders that contains at least a "X" format or also the ones that olny contains "X" and not anything else, I dont know if I'm expesing myself...

I should be an easy task so it's weird if it can not be done with TC.
Ralph
Member
Member
Posts: 100
Joined: 2004-08-21, 14:58 UTC
Location: USA

Post by *Ralph »

You can display only those directories containing files that match some search criteria, by using a DiskDir .lst file or a .zip file. The method for creating an .lst file is described below. The benefit of creating an .lst file is speed and small size. This method will deal with your Any condition, but not your Only condition.

0. First, install the DiskDir plugin (http://www.ghisler.com/plugins.htm). Use of the default extension (.LST) is assumed here.
The DiskDir Extended plugin also should work for this purpose.

1. Search for the files of interest (Alt+F7).
Click on Feed To listbox.
Select all of the files in the resulting virtual directory.
Choose a target directory to hold the .lst file.

2. In the source (virtual) directory, open the Pack dialog (Alt+F5).
Maybe edit the name of the output .lst file. If an .lst file of that name already exists, it must be erased first.
Check Also pack path names and Recursively pack subdirectories.
Using the Packer drop-down arrow, select the lst "packer."
OK.

3. Double-click on the .lst file to enter into it as though it were a virtual directory structure. Directories and files not matching your criteria will not be shown within.
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

It would be better to use virtual panel instead of diskdir BTW because opening files via diskdir requires to copy them to temporary folder while files from virtual panel may be opened directly. However such ways allow displaying only snapshots of folders w/o updating their contents... Maybe it is possible to write script for virtual panel to update panels but it isn't easy.
Ralph
Member
Member
Posts: 100
Joined: 2004-08-21, 14:58 UTC
Location: USA

Post by *Ralph »

MVV: With TC 8.51 B4, I can use the files listed within an .lst file; for example, I can view the contents of those files via the Lister, and I can copy those files to other locations, even though the actual files are not within the .lst file. If I recall correctly, not long ago, the .lst file had to be on the same drive as the files to be viewed or copied, but now there doesn't appear to be a same-drive limitation.

I understand that the static snapshot of a virtual panel or an .lst file would not be as satisfactory as an automatically-updated listing. However, for what it is worth, I have not encountered much need for the Any condition, and never a need for the Only condition. Therefore, I don't mind using a virtual panel or an .lst file.
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

When you list files from .lst, TC extracts (copies) them to temporary folder: check path in lister window title. So it will be extremely slow and useless in case of huge files like videos or backups. Virtual panel is a special FS plugin that provides direct paths to files instead of extracting them to temporary folder.
Ralph
Member
Member
Posts: 100
Joined: 2004-08-21, 14:58 UTC
Location: USA

Post by *Ralph »

MVV: Now I see what you mean with respect to TC's use of a temporary folder. It would be nice if TC could bypass the temporary folder for .lst files. I use .lst files quite frequently, but I don't know if enough other people would also, to justify such an improvement.

DirSizeCalc examines entire directories, so maybe it could provide a starting point if somebody wanted to program. Then perhaps the relevant directories could receive a particular color through "Define colors by file type."
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Unfortunately packer plugins' interface doesn't allow returning direct paths instead of extracting (TC just calls extraction function and tells where to unpack files), and since diskdir is a packer plugin, it can do nothing with this restriction.
Post Reply