rejetto forum

%diskfree% command only works for "real" folders, not virtual.

Steven · 13 · 7434

0 Members and 1 Guest are viewing this topic.

Offline Steven

  • Occasional poster
  • *
    • Posts: 13
    • View Profile
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
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
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
Gotcha.
Just saw it in the wiki after I posted. Should have looked it over more thoroughly.


Age

  • Guest
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: 681
    • View Profile
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: 13523
    • View Profile
%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
"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
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: 13523
    • View Profile

Offline Age

  • Occasional poster
  • *
    • Posts: 17
    • View Profile
    • Integers of K
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: 13523
    • View Profile

Offline Age

  • Occasional poster
  • *
    • Posts: 17
    • View Profile
    • Integers of K