Using WriteSize()


A few folders and files and their respective sizes:
there - 1,1 MB (1195743 bytes)
_gfx - 260 bytes (260 bytes)
default.asp - 1,4 KB (1389 bytes)
folder.gif - 102 bytes (102 bytes)
text.html - 291 bytes (291 bytes)
title.png - 4,3 KB (4399 bytes)

Just testing: 19238536679 bytes equals 17,9 GB : )

Contents of default.asp :
<!-- The includefile is one level back from the "default.asp" file: -->
<!--#include file ="../../jakes_IO.asp"-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="da">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Example use of the WriteSize function</title>
    <link rel="stylesheet" type="text/css" href="/jake.css">
</head>
<body>
    <div align="center"><h1>Using WriteSize()</h1></div>
    <br>
    <b>A few folders and files and their respective sizes:</b>
    <span style="display:block;border:1px solid black;background:#DFE;padding:10px;font-size:11px;">
    <%
    dim file, theSize
    for each folder in getFoldersFromFolder(".")
        theSize = getsize(folder)
        response.write("<br><img src='_gfx/folder.gif'> " & folder & " - " & writeSize(theSize) & " (" & theSize & " bytes)")
    next    
    for each file in getFilesFromFolder(".")
        theSize = getsize(file)
        response.write("<br><img src='_gfx/doc.gif'> " & file & " - " & writeSize(theSize) & " (" & theSize & " bytes)")
    next    
    %>
    <p>Just testing: 19238536679 bytes equals <%=writeSize(19238536679)%> : )
    </span>
    <p><b>Contents of default.asp :</b><br>
    <span style="display:block;border:1px solid black;background:#FDE;padding:10px;font-size:11px;">
    <% response.write(stringToHTML (GetFileContents("default.asp")))%>
    </span>

</body>
</html>