Other types of mini-Tree

Features wanted...
DmFedorov
Posts: 680
Joined: 04 Jan 2011 16:36
Location: Germany

Re: Other types of mini-Tree

Post by DmFedorov »

highend wrote: It needs the modified time of all files in the search path^^ Otherwise something like "show me all files
modified in the last 7 days" wouldn't be possible.
I agree, I need to find all files first.

Could you somehow describe this at least in words.
For example, we do a search using such and such command.
We put the search results into a paper folder using such and such command.
We call the loadtree command and somehow put in it a paper folder.
We get a frozen tree and move on it.

highend
Posts: 13317
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Other types of mini-Tree

Post by highend »

This isn't a "just a few lines" script

quicksearch() to get the files with timestamps (flag = "m")
now you need to do timediff(s) for the current date and
the time difference you want to find (e.g. 7 days)
calculate regex patterns for all items (year, months, day, hour, minute, second)
now regexmatches the list of files with this pattern to find only those files
that match the criteria
why that?
without doing this you would need to loop over all files and trust me, you
don't want to do that with 10k++ files...

paperfolder() + evtl. a branch view because creating dozens of paperfolders will
lead to serious naming problems
One of my scripts helped you out? Please donate via Paypal

DmFedorov
Posts: 680
Joined: 04 Jan 2011 16:36
Location: Germany

Re: Other types of mini-Tree

Post by DmFedorov »

highend
I could not see in your answer all the steps that I need to achieve the goal.
I saw only the first. And even this step I could not do until the end.

Yes, I realized that the shorter the date range, the less data will be.
This is exactly what I need.
In case that something happened to the computer, the date range is from a few seconds to a minute. Maximum one hour.

you write: after it I need to do time difference for the current date and the time difference for what I want to find.
I realized this in such a way: I need to count from the current date for example 7 days and then set the search time range to 1 minute.
This is a very inconvenient way. The current time changes with every minute.
It is much more convenient to set the time as usual <datem yyyymmdd_hhnnss> | <datem yyyymmdd_hhnnss>

But I don't know how to do it. In the help there is no such example.

I see only this:
Search the current path for all items modified on a weekend:
text quicksearch("dateM: dw 6 | dw 7");
--------------
Ok. This is only first step and I can not do it.

Suppose I get a list similar to: text quicksearch("dateM: dw 6 | dw 7");
Next, I have to load this list in loadtree.
But script command loadtree can not give me a list of folders with specific files.
The command loads only folders with all files.
---------------
I found another way how to make such tree.
Help me write script.
I can specify a global visual filter. For example: dateM: 2012.12.01 - 2012.12.02
Now I don't need specify time range to quicksearch.
After the folders with the files (changed in time range of global visual filter) are found, I need to make a tree from these folders.
As a result, the tree will show the required folders, and the global filter will filter the contents of the folders.
The script should be able to disable mini-tree and global visual filter (Through a key combination or button)

highend
Posts: 13317
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Other types of mini-Tree

Post by highend »

Code: Select all

    $location = "%systemdrive%";

    $notes = <<<>>>
Enter time as a digital value, e.g. 5
Add the unit as:
y = years
m = months
w = weeks
d = days
h = hours
n = minutes
or
s = seconds

Time and unit can be written together (4d)
or separated via a space (4 d)

Default is 60 minutes (60n)
>>>;
    $timeSpan = input("Enter the timeframe...", $notes, "60n");
    if (!$timeSpan) { status "No timeframe given, aborted!", "8B4513", "stop"; end true; }

    $time = regexmatches($timeSpan, "^\d+");
    $unit = regexmatches($timeSpan, "([ymwdhns])$");
    $range = $time . " " . $unit;
    // $unit = y=yearsh, m=months, w=weeks, d=days, h=hours, n=minutes, s=seconds

    $modified = quicksearch("ageM: <= $range /f /excl=\$Recycle.Bin\|\System Volume Information\", $location, "|", "s");

    // Get folders
    $folders = formatlist(regexreplace($modified, "[^\\]*?(\||$)", "|"), "ed");

    // Load tree
    loadtree $folders;

    // Set visual filter
    filter "ageM: <= $range", 2+4;
One of my scripts helped you out? Please donate via Paypal

DmFedorov
Posts: 680
Joined: 04 Jan 2011 16:36
Location: Germany

Re: Other types of mini-Tree

Post by DmFedorov »

Thanks for the script.
I'll try to make it work. (Unfortunately not now, tomorrow)
I already manually found the problem (before your script).
If I put a global visual filter with a time range and then do a search through the info panel with inactive filters there, I get the correct result.
But by searching with the same time range through info-pane, i will found a very little or nothing.
Perhaps this is a bug. It seems like that.
-----------
But your script works, it requires only debugging.
Thanks again.

highend
Posts: 13317
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Other types of mini-Tree

Post by highend »

Then reset the gvf in the script before it uses quicksearch()...
One of my scripts helped you out? Please donate via Paypal

DmFedorov
Posts: 680
Joined: 04 Jan 2011 16:36
Location: Germany

Re: Other types of mini-Tree

Post by DmFedorov »

Of course, this is the first thing I thought about.
It is necessary to put global visual filter in the beginning of script, and then to make "search" without nothing.
I will create a special folder in which there will be files in different time ranges and then I will search in the parent folder.
As a result, only one folder should be in the tree. Only this folder will have the necessary files.

DmFedorov
Posts: 680
Joined: 04 Jan 2011 16:36
Location: Germany

Re: Other types of mini-Tree

Post by DmFedorov »

So far, the script shows me a tree with the final folders in which there are no files at all.
This should not be in principle.
I hope I can fix this.
------------
Thanks again for the script.

highend
Posts: 13317
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Other types of mini-Tree

Post by highend »

It works fine on any folder I've tested, even on %systemdrive%...
One of my scripts helped you out? Please donate via Paypal

DmFedorov
Posts: 680
Joined: 04 Jan 2011 16:36
Location: Germany

Re: Other types of mini-Tree

Post by DmFedorov »

The script itself is working. But the result is still incorrect.
I do not know the commands well enough and it takes me a while to remember what they can do.
I hope that everything will work correctly.
That's why I'll create a special folder later.
------------
I do not know how to change this line:

Code: Select all

$modified = quicksearch("ageM: <= $range /f /excl=\$Recycle.Bin\|\System Volume Information\", $location, "|", "s");
I need quicksearch with
excl=\$Recycle.Bin...,
but without a time range
ageM: <= $range

highend
Posts: 13317
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Other types of mini-Tree

Post by highend »

Then maybe you should post the $location and what you entered into the input box?
As well as the definition of the gvf after the script run through?
Additionally a screenshot of what the normal gui search finds with the same parameters (translated from quicksearch)?

Code: Select all

$modified = quicksearch("/f /excl=\$Recycle.Bin\|\System Volume Information\", $location, "|", "s");
"Something doesn't work" isn't an error message... And without providing exact information about what doesn't
work...
One of my scripts helped you out? Please donate via Paypal

DmFedorov
Posts: 680
Joined: 04 Jan 2011 16:36
Location: Germany

Re: Other types of mini-Tree

Post by DmFedorov »

I have to go.

I'll have to set a filter similar to this filter

Code: Select all

    filter "dateM: 2012.12.01 - 2012.12.02",;
Filter with an exact date.
-------------
In general, I will have to figure out how to do it.

highend
Posts: 13317
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Other types of mini-Tree

Post by highend »

The whole script isn't build around fixed dates (and from what you posted earlier: you need something
that shows these folders that contain files that changed only seconds ago, not a full day)...
One of my scripts helped you out? Please donate via Paypal

DmFedorov
Posts: 680
Joined: 04 Jan 2011 16:36
Location: Germany

Re: Other types of mini-Tree

Post by DmFedorov »

highend wrote:The whole script isn't build around fixed dates (and from what you posted earlier: you need something
that shows these folders that contain files that changed only seconds ago, not a full day)...
I'll still try to do it as I do it manually.
1) I specify the global filter dateM: 2012.12.01 - 2012.12.02
2) I do a search in the info panel without specifying a date. I'm looking for everything on disk.
Search time 12 seconds.

I think I will succeed. I'll get the same result, but with the tree.
The search for a second, a minute ago, does not give anything in a critical situation.
We need an exact time range.

Added
I will report here, of course, what I did.

highend
Posts: 13317
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Other types of mini-Tree

Post by highend »

Whatever... <- Out
One of my scripts helped you out? Please donate via Paypal

Post Reply