rejetto forum

Software => HFS ~ HTTP File Server => Bug reports => Topic started by: Steven on October 06, 2009, 01:39:10 AM

Title: %diskfree% command only works for "real" folders, not virtual.
Post by: Steven on October 06, 2009, 01:39:10 AM
Well, on my root VFS, I have many real folders and a couple virtual ones. I'm using a custom template based loosely off terayon Great template BTW ;)
Anyhow, on the main page I have a %diskfree% so I can see how much space I'm using. Anytime I browse to a virtual folder, or home, it shows 0B, once I browse into a real folder, it shows 819GB
Any idea how I can get it to show all the time?
Title: Re: %diskfree% command only works for "real" folders, not virtual.
Post by: Steven on October 06, 2009, 03:11:28 AM
Sorry, didn't mean to put this in "Bug reports" was searching all forums for a solution just ended up browsing this one last.
Meant to put it under HTML & Templates.
Anyhow, it may be a bug, so here we go:

Running 2.3 beta build 246
Terayon 1.3.2
Windows server 2003 x64
Title: Re: %diskfree% command only works for "real" folders, not virtual.
Post by: maverick on October 06, 2009, 04:46:20 AM
Anytime I browse to a virtual folder, or home, it shows 0B, once I browse into a real folder, it shows 819GB.  Any idea how I can get it to show all the time?

I'm not sure I totally understand what you are asking.  If you are asking how to show the amount of free disk space there is in a virtual folder there is no answer.  A virtual folder is virtual.  %diskfree% is for real folders located on your harddrive.

You would put the %diskfree% symbol in the [file] section of the template.
Title: Re: %diskfree% command only works for "real" folders, not virtual.
Post by: Steven on October 06, 2009, 08:16:42 AM
Gotcha.
Just saw it in the wiki after I posted. Should have looked it over more thoroughly.
Title: Re: %diskfree% command only works for "real" folders, not virtual.
Post by: Age on November 27, 2009, 08:43:25 AM
I realize this question has been answered, though I would like to add to it.


Is there anyway I can display %diskfree% "of folder x" on the root page?  The root itself is virtual, but is there anyway to specify the folder to which the %diskfree% refers?
Title: Re: %diskfree% command only works for "real" folders, not virtual.
Post by: bacter on November 27, 2009, 11:26:14 AM
It is meaningless to show the %diskfree% value

a) in a homepage (what says that to a visitor?). If someone needs to show what a big server he owns, then simply put '8 TBytes of storage'  ;D ;D ;D

b) in a folder for upload the %diskfree% value should not be shown, but used to disable uploads to the server when %diskfree% is less than about 10% of the disks capacity. If you fill up more a disk, your PC can become very slow. When you show directly the free capacity, users might think they could upload until filled.
Title: Re: %diskfree% command only works for "real" folders, not virtual.
Post by: rejetto on November 27, 2009, 02:44:45 PM
%diskfree% will not change,
but i will add another command {.disk free| your-path .}
in next release
Title: Re: %diskfree% command only works for "real" folders, not virtual.
Post by: Age on November 27, 2009, 08:10:52 PM
"but i will add another command {.disk free| your-path .}"

Awesome. You're the best.
Title: Re: %diskfree% command only works for "real" folders, not virtual.
Post by: Age on January 26, 2010, 12:46:05 PM
Was this actually added in 252? I'm having trouble getting it to work, but it's probably just lack of experience with these fun macros.
Title: Re: %diskfree% command only works for "real" folders, not virtual.
Post by: rejetto on January 26, 2010, 01:45:51 PM
yes, it's available since #250, but i forgot to announce it and document it.
please refer to http://www.rejetto.com/wiki/index.php/HFS:_scripting_commands#File_manipulation
Title: Re: %diskfree% command only works for "real" folders, not virtual.
Post by: Age on January 26, 2010, 04:09:14 PM
Oh awesome. Thank you sir! It works great!


However (yeah there always seems to be a "but" doesn't there?), it returns the disk free value in bytes. Is there anyway to display it in the 'regular' %diskfree% style?


Right now it displays:
"Disk space: 14535438336"
When I think we would prefer that it displays:
"Disk space: 13.54 GB"
Title: Re: %diskfree% command only works for "real" folders, not virtual.
Post by: rejetto on January 26, 2010, 08:20:27 PM
{.round|{.div| {.disk free|C:\.} | 1073741824.}|2.}
Title: Re: %diskfree% command only works for "real" folders, not virtual.
Post by: Age on January 27, 2010, 11:37:55 PM
Oh yes, of course!

Thanks again rejetto. Works great.