Author Topic: %diskfree% command only works for "real" folders, not virtual.  (Read 2464 times)

0 Members and 1 Guest are viewing this topic.

Offline Steven

  • Occasional poster
  • *
  • Posts: 13
    • View Profile
%diskfree% command only works for "real" folders, not virtual.
« 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?

Offline Steven

  • Occasional poster
  • *
  • Posts: 13
    • View Profile
Re: %diskfree% command only works for "real" folders, not virtual.
« Reply #1 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

Offline maverick

  • Tireless poster
  • ****
  • Posts: 1052
  • Computer Solutions
    • View Profile
Re: %diskfree% command only works for "real" folders, not virtual.
« Reply #2 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.
maverick

Offline Steven

  • Occasional poster
  • *
  • Posts: 13
    • View Profile
Re: %diskfree% command only works for "real" folders, not virtual.
« Reply #3 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.

Age

  • Guest
Re: %diskfree% command only works for "real" folders, not virtual.
« Reply #4 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?

Offline bacter

  • Operator
  • Tireless poster
  • *****
  • Posts: 682
    • View Profile
Re: %diskfree% command only works for "real" folders, not virtual.
« Reply #5 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.
your computer has no brain - use your own !

Offline rejetto

  • Administrator
  • Tireless poster
  • *
  • Posts: 12953
    • View Profile
Re: %diskfree% command only works for "real" folders, not virtual.
« Reply #6 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

Offline Age

  • Occasional poster
  • *
  • Posts: 17
    • View Profile
    • Integers of K
Re: %diskfree% command only works for "real" folders, not virtual.
« Reply #7 on: November 27, 2009, 08:10:52 PM »
"but i will add another command {.disk free| your-path .}"

Awesome. You're the best.

Offline Age

  • Occasional poster
  • *
  • Posts: 17
    • View Profile
    • Integers of K
Re: %diskfree% command only works for "real" folders, not virtual.
« Reply #8 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.

Offline rejetto

  • Administrator
  • Tireless poster
  • *
  • Posts: 12953
    • View Profile
Re: %diskfree% command only works for "real" folders, not virtual.
« Reply #9 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

Offline Age

  • Occasional poster
  • *
  • Posts: 17
    • View Profile
    • Integers of K
Re: %diskfree% command only works for "real" folders, not virtual.
« Reply #10 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"

Offline rejetto

  • Administrator
  • Tireless poster
  • *
  • Posts: 12953
    • View Profile
Re: %diskfree% command only works for "real" folders, not virtual.
« Reply #11 on: January 26, 2010, 08:20:27 PM »
{.round|{.div| {.disk free|C:\.} | 1073741824.}|2.}

Offline Age

  • Occasional poster
  • *
  • Posts: 17
    • View Profile
    • Integers of K
Re: %diskfree% command only works for "real" folders, not virtual.
« Reply #12 on: January 27, 2010, 11:37:55 PM »
Oh yes, of course!

Thanks again rejetto. Works great.