Clone a FlatView-Tab without reindexing

Hi there.
Is it possible to reopen an already processed flat view tab in a new tab without reindexing?
Is there a flat_view_cache setting or something similar?

Flat view on small folders is really fast.
But when man want to make a flat view on an root-folder, there are many thousands files.
This can take some time. An when the whole process go in an remote computer - very long time.

Therefore is a Flat-View-Cache very important.

I have been trying to achieve Caching functionality through Collections, and it is a temporary Solution.
For one folder flat-view-cache, this button do the job.
So my button xml:

<?xml version="1.0"?>
<button backcol="none" display="label" separate="yes" textcol="none">
	<label>Cache FlatView Files</label>
	<tip>Add selected to FlatView-Cache</tip>
	<icon1>#newcommand</icon1>
	<function type="normal">
		<instruction>Copy TO &quot;coll://FlatView-Cache&quot; WHENEXISTS=skip </instruction>
	</function>
</button>

But when for many cached folders i need something to create a subcollection like that:

		<instruction>Copy TO &quot;coll://FlatView-Cache/{sourcepath}&quot; WHENEXISTS=skip </instruction>

Unfortunately It's not working.

So my Questions:
How can i get the name of the current folder of the current lister?
Replace in the foldername all Slashes and Backslasches with __?

Ok. I am near.

the string replacing and the creation of flat-view-cache sub collection can be done for dos batch with:

set str=\\HOST\Path
echo.%str%
set str=%str:\=__%
echo.%str%
"C:\Program Files\GPSoftware\Directory Opus\dopusrt.exe" /acmd CreateFolder "coll://FlatView-Cache/%str%"

but, when i try to do that inside a button. Nothing happens.

set str={sourcepath}
set str=%str:\\=__%
dopusrt.exe /acmd CreateFolder "coll://FlatView-Cache/%str%"
dopusrt.exe /acmd Copy TO "coll://FlatView-Cache/%str%" WHENEXISTS=skip

What am i doing wrong?

If you just want to put a folder into a collection, doing a Find on * is probably better.

I'm not really sure what the rest of your command is trying to do, but you're mixing MS-DOS set commands and variables with Opus ones, which won't work.

If you need detailed help, please link your account.

i just linked my account.

I'am trying to make a Button, that take the name of one folder, which is displayed in flatview mode,
and create collection with this folder name and all displayed files as member. Without recreating the structure.
The Problem:
The full Foldername i.e \\192.168.0.0\path\subpath contains Backslashes which can not be used for single collection name,
because the Backslashes make Dopus to recreate the Structure.
\\192.168.0.0
\\192.168.0.0\path
\\192.168.0.0\path\subpath

So i need to replace the Backslashes with something, i.e. "__".
I don't find such text replacement functionality in Opus.
I am not sure if the internal opus command can be used, an if yes how.

Therefore i have tried to use the Dos batch for that.
The simple 2 line batch code to string replacement '\'->'__'

set str=\\host\with\backslashes
set str=%str:\\=__%

At the end the variable str i equal "__host_with_backslashes"
With this text i am able to have well named collection.

But as you said mixing of DOS and DOPUS command and arguments, wont work.

How can i use the Dopus arguments (inside a button) with DOS-Batch?

i double checked the manual.
The example for Dos-Batch is a dos command and dopus argument like this:

cd {sourcepath}

i am not doing very different thing:

set str={sourcepath}

I am not mixing anything.

You are using set which is a DOS command.

If you want to use local variables in DOpus you have to use @set

See help for this


Set is also an Opus command (not to be confused with @set which is an Opus command modifier), and by default it's the Opus command that gets run rather than the DOS command.

From looking at the button, I'd say it is the DOS command that is wanted, so you need to add @externalonly to prevent any Opus commands from being used. Adding that on a line by itself at the top of the button may be enough to fix it.

To clarify:
The button code is set to be MS-DOS-Batch in the dropdown box above the code text area.

So i tried @externalonly and added a pause at the end.

@externalonly 
set str=\\HOST\Path
echo.%str%
set str=%str:\=__%
echo.%str%
pause

I was surprised to see the black dos screen:
%str%
%str%

So i did put this code in a ".bat" file and everything was as expected:

\\HOST\Path
____HOST__Path

My Conclusion:
the MS-Batch in Opus Interpreter differs from the real MS-Batch.
"%str%" should be the value of "str"-variable.
But it is not the case in Opus MS-Batch interpreter.

What now?
How can i fix it?

Or is there better Solution for text replacement with internal Opus command?
Or much much better, is there an internal Opus file that contain the Flat-View listing?

Remove the dot from

echo.%str%

i.e.

echo %str%

and it seems to work.

Thanks.

one little dot.. :smiley:

The complete cache Button is ready to use.
Only the path of the Opus-Installation should be adjusted if needed:

<?xml version="1.0"?>
<button backcol="none" display="label" separate="yes" textcol="none">
	<label>Cache FlatView</label>
	<tip>Add selected to FlatView-Cache</tip>
	<icon1>#newcommand</icon1>
	<function type="batch">
		<instruction>@externalonly </instruction>
		<instruction>set str={sourcepath}</instruction>
		<instruction>set str=%str:\=__%</instruction>
		<instruction>set str=%str::=__%</instruction>
		<instruction>set str=%str:/=__%</instruction>
		<instruction />
		<instruction>&quot;C:\Program Files\GPSoftware\Directory Opus\dopusrt.exe&quot; /acmd CreateFolder &quot;coll://FlatView-Cache&quot;</instruction>
		<instruction>&quot;C:\Program Files\GPSoftware\Directory Opus\dopusrt.exe&quot; /acmd CreateFolder &quot;coll://FlatView-Cache/%str%&quot;</instruction>
		<instruction />
		<instruction>&quot;C:\Program Files\GPSoftware\Directory Opus\dopusrt.exe&quot; /acmd Select ALL</instruction>
		<instruction>&quot;C:\Program Files\GPSoftware\Directory Opus\dopusrt.exe&quot; /acmd Copy TO &quot;coll://FlatView-Cache/%str%&quot; WHENEXISTS=skip FLATVIEWCOPY=single  </instruction>
	</function>
</button>

It do cache all files and folders in the current view.

The only thing "WHENEXISTS=skip" seems not to working.
I get a dialog "skip, skip all, abort".

You should be able to remove the Select ALL by doing Copy * TO ... instead of Copy TO ...

For the WHENEXISTS problem, I think it would make sense to delete any existing collection before creating the new one. The Scrap Collection Toolbar has an example, on the "Clear Scrap[/b] button, but I think you just need to add this (with the dopusrt stuff) between the two CreateFolder commands:

Delete QUIET FILE="coll://FlatView-Cache/%str%"

hi leo.
i tried your suggestion to change select all +"copy to" in "copy * to".
This behave differently. The items that will be copied are not the same as these from the flatview, but the same of normal view.
I mean the foldernames but not their content files are copied.

The second suggestion works, only that it should be inserted before both creating folders commands.
Otherwise the FlatView-Cache/%str% is delete, created again, but strangely the files are being added to its parent folder FlatView-Cache.
I don't now why.
It doesn't matter.

Problem solved.
Thanks.