rejetto forum

Software => HFS ~ HTTP File Server => Topic started by: parade on March 21, 2009, 01:08:20 PM

Title: Archivable for folder level
Post by: parade on March 21, 2009, 01:08:20 PM
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?
Title: Re: Archivable for folder level
Post by: r][m on March 21, 2009, 05:29:53 PM
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.
Title: Re: Archivable for folder level
Post by: parade on March 21, 2009, 07:01:47 PM
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.
Title: Re: Archivable for folder level
Post by: bacter on March 22, 2009, 08:27:56 AM
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.
Title: Re: Archivable for folder level
Post by: Mars on March 22, 2009, 11:36:54 AM
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.}
Title: Re: Archivable for folder level
Post by: parade on March 24, 2009, 03:13:08 PM
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?
Title: Re: Archivable for folder level
Post by: rejetto on March 25, 2009, 12:58:31 PM

this script doesn't work. a better solution is provided below (http://www.rejetto.com/forum/index.php?topic=6776.msg1042598#msg1042598).

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.}
Title: Re: Archivable for folder level
Post by: parade on April 18, 2009, 09:31:12 AM
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?
Title: Re: Archivable for folder level
Post by: rejetto on April 18, 2009, 02:08:57 PM
i will debug it for you asap
Title: Re: Archivable for folder level
Post by: rejetto on April 20, 2009, 11:14:33 AM
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.}
Title: Re: Archivable for folder level
Post by: parade on April 24, 2009, 08:39:50 PM
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.
Title: Re: Archivable for folder level
Post by: rejetto on April 27, 2009, 05:04:36 PM
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
Title: Re: Archivable for folder level
Post by: parade on August 12, 2009, 10:26:56 AM
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.
Title: Re: Archivable for folder level
Post by: rejetto on August 13, 2009, 02:04:59 PM
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)
Title: Re: Archivable for folder level
Post by: rioborg on September 03, 2013, 03:04:55 PM
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.
Title: Re: Archivable for folder level
Post by: Mars on September 03, 2013, 05:21:08 PM
you can create a folder "music" and some sub-folders (one for each "artist" ),  all must been virtual folders into the VFS.


then for each "artist" folder in the VFS, just add the directories C:\music\b\artist\album as real folder, it will be included in the vfs with the same name.


After you select the "album" folder and go to the properties (ALT+ENTER)  and set Archivable box in the FLAGS tab.

 ;)
Title: Re: Archivable for folder level
Post by: rioborg on September 04, 2013, 12:35:17 AM
I'm talking about thousands of folders, it's simply too much to do manually.
 :(
Title: Re: Archivable for folder level
Post by: rejetto on September 17, 2013, 10:29:19 PM
yes, you can, just as reported in the previous post
http://www.rejetto.com/forum/hfs-~-http-file-server/archivable-for-folder-level/msg1042598/#msg1042598

see the number "5" ?
that's what you have to tweak.