rejetto forum

Archivable for folder level

parade · 18 · 8807

0 Members and 1 Guest are viewing this topic.

Offline parade

  • Tireless poster
  • ****
    • Posts: 138
    • View Profile
Hi,

I have a real folder with 4 levels of subfolders and thousands of files in it.
Is there a way to make the subfolders archivable at a special level.
Naturally I don't want to  allow users to make an archive of the complete folder an even not of the 3 next levels, because that would mean really big archives.
But I would like to make the subfolder of the fourth level archivable.

Is there a way to do this without including hundreds of subfolders of this fourth level in the VFS?


Offline r][m

  • Tireless poster
  • ****
    • Posts: 347
    • View Profile
The way I've done this is.....
I have made the folder one level above those I want to archive virtural.
That way I can see all the folders inside it in the vfs window.
I select all these folders at once using shift key method. Then right
click on the selection and go to Properties > Flags and check Archivable.
Some things to note though, If the folder you make virtural contains a
very large number of files, it will be slow to load on start up.
The other thing is that presently in build 230 (and probably previous
builds) archivable may not work at 4 levels deep. The user will get a
empty archive (.tar). It has worked for me at 3 levels deep.
You might also want to be sure Archivable not checked for the root
as all below will inherit the function.
I think Rejetto is looking into the problem.


Offline parade

  • Tireless poster
  • ****
    • Posts: 138
    • View Profile
That way I can see all the folders inside it in the vfs window.
I select all these folders at once using shift key method. Then right
click on the selection and go to Properties > Flags and check Archivable.
I have far too much files for a virtual folder.

And it would be far too much work to make folders archivable in that way.
Because I only want that feature for the 3rd or 4th subfolder level I would have to open hundreds of folders to see the subfolders.


Offline bacter

  • Operator
  • Tireless poster
  • *****
    • Posts: 681
    • View Profile
a possible workaround with macro:
use %parent-folder% to determine the level of nested directories. Depending of this level, show or hide the archive option.
your computer has no brain - use your own !


Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2059
    • View Profile
have a look about %bread-idx% , it return the current sub-level index 0=root, 1 is first ...

{if not|{.in range|2|%bread-url%|5.}| can archive|no archive.}


Offline parade

  • Tireless poster
  • ****
    • Posts: 138
    • View Profile
have a look about %bread-idx% , it return the current sub-level index 0=root, 1 is first ...

{if not|{.in range|2|%bread-url%|5.}| can archive|no archive.}

Well, I am more a kind of user of ready available templates. So far the only thing I did with templates was changing smaller things like colors, text, picturs and so on.
Mostly I did this with try and errot. ;)

I am using RAWR-template. Can anybody tell me where and in what way I have to insert this code?


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile

this script doesn't work. a better solution is provided below.

this solution is untested, and works only with last 2.3 release

ALT+F6
then put this stuff

Code: [Select]
[+request]
{.if
|{.and
  |{.pos|~folder.tar|%url%.}
  |{. {.count substring|/|%url%.} > 4 .}
/and.}
|{:{.disconnection reason| Ayyyy, you want too much!.}:}
/if.}
« Last Edit: April 20, 2009, 11:16:03 AM by rejetto »


Offline parade

  • Tireless poster
  • ****
    • Posts: 138
    • View Profile
this solution is untested, and works only with last 2.3 release

I finally found time to try it.
Had to read about events first.
As far as I understand the script (I am not common with the syntax) there should be a warning if someone tries to download an archive if it's URL has more then 4 slashes.

It doesn't seem to work.
I enabled "Archivable" for the real folder and all folders are archivable.
What am I doing wrong?


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile

Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
Ok, this version should work instead.
But the message will be displayed only from next beta version.

Code: [Select]
[+download]
{.if
|{.and
  |{.pos|~folder.tar|%url%.}
  |{. {.count substring|/|%url%.} < 5 .}
/and.}
|{:{.disconnection reason| Ayyyy, you want too much!.}:}
/if.}


Offline parade

  • Tireless poster
  • ****
    • Posts: 138
    • View Profile
Ok, this version should work instead.
But the message will be displayed only from next beta version.
As it still doesn't work here, I think I must do something wrong.

This is what I'm doing:

HFS-Beta 2.35
Template: RAWR
Flag folder as archivable
Put the code with Alt-F6
Save as hfs.events in the HFS-Folder

The folder and it's subfolders are all archivable. There ist no disconnection and no warning.


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
1. menu > debug > enable macros.log
2. download a folder archive that should NOT be allowed
3. before any other request is made, move the file macros.log from the HFS folder to another one, like your desktop
4. attach the file here on the forum

step 3 is because any other request will overwrite the file with useless info


Offline parade

  • Tireless poster
  • ****
    • Posts: 138
    • View Profile
Sorry that I did not answer to your suggestion for such a  long time, but I have been away from home quite a long time and since then I only started some days ago to look after my HFS-configuration.

1. menu > debug > enable macros.log
2. download a folder archive that should NOT be allowed
3. before any other request is made, move the file macros.log from the HFS folder to another one, like your desktop

I enabled Macro-logging with you script. There ist nothing concerning to this script in the macro.log.
I made some experiments with hfs.events using your example from your hfs-introduction-thread:

Code: [Select]
[download]
{.if|{.is substring|%item-name%|hey.}| {:
  {.set speed limit for connection| 10 .}
:}.}

This code works and is logged in macro.log.

I looked again ant you code-suggestion for my problem and tried to understand it and maybe find errors. As I told you, I do not understand much of this syntax, but 2 questions:

1. Should it not be [download] instead of [+download]? Anyway it did not work with [download] either.

2. Shouldn't there not be a {.disconnect.} in the code?

If I ever get it to work with hfs.events: Is there a way to make it different for different folders in vfs.
The reason: Some folders should be allowed to archive at the 3rd subfolder, some at the 4th subfolder a.s.o.


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
1. the "+" make it compatible with other scripts.
if you another script is installed on [download], another one will overwrite it, unless you put the "+" ahead.

2. "disconnection reason" is misleading, but it does actually disconnect!

3. yes, it's possible.

i guess a good programmer on your computer may help you find the problem (because on my PC it works)


Offline rioborg

  • Occasional poster
  • *
    • Posts: 2
    • View Profile
First, sorry for the reply in this old topic.

I recently found out about this software and so far it's been very easy and simple to use.

OP situation seems to be the same situation I am facing here.

I have a huge number of subfolders and I don't want the user to try to archive the main folder with all subfolders.

This is what the folder structure of my music files looks like:
C:\music\a\artist\album
C:\music\a\artist\album\flac
C:\music\b\artist\album
C:\music\b\artist\album\flac
C:\music\c\artist\album
C:\music\d\artist\album
C:\music\e\artist\album

I want the to allow the user to archive only: \album\ or \flac\ or \album\flac\

Is it possible to achieve that?

Thank yoy for your time and your reply.