This repository was archived by the owner on Aug 31, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 223
Expand file tree
/
Copy pathdiskSpace.xml
More file actions
49 lines (49 loc) · 2.56 KB
/
Copy pathdiskSpace.xml
File metadata and controls
49 lines (49 loc) · 2.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<doc>
<legacy_id>1516</legacy_id>
<name>diskSpace</name>
<type>function</type>
<syntax>
<example>the diskSpace</example>
<example>diskSpace()</example>
</syntax>
<library></library>
<objects>
</objects>
<synonyms>
</synonyms>
<classification>
<category>The System Environment</category>
</classification>
<references>
<function tag="stackSpace">stackSpace Function</function>
<function tag="hasMemory">hasMemory Function</function>
<function tag="volumes">volumes Function</function>
<property tag="freeSize">freeSize Property</property>
<property tag="size">size Property</property>
</references>
<history>
<introduced version="1.0">Added.</introduced>
</history>
<platforms>
<mac/>
<windows/>
<linux/>
</platforms>
<classes>
<desktop/>
<server/>
<web/>
</classes>
<security>
<disk access="???"/>
</security>
<summary><glossary tag="return">Returns</glossary> the amount of free space on the disk that holds the <property tag="defaultFolder">defaultFolder</property>.</summary>
<examples>
<example>the diskSpace</example>
<example>put the diskSpace div (1024^2) into megabytesAvailable</example>
<example>if the diskSpace &lt; spaceNeeded then exit mouseUp</example>
</examples>
<description>
<p>Use the <b>diskSpace</b> <control_st tag="function">function</control_st> to determine whether there is enough free space to complete an action (such as <glossary tag="download">downloading</glossary> data).</p><p/><p><b>Value:</b></p><p>The <b>diskSpace</b> <control_st tag="function">function</control_st> <glossary tag="return">returns</glossary> an <keyword tag="integer">integer</keyword>.</p><p/><p><b>Comments:</b></p><p>The value returned by the <b>diskSpace</b> <control_st tag="function">function</control_st> is in <glossary tag="byte">bytes</glossary>. To convert to kilobytes (K), divide the <glossary tag="return value">return value</glossary> by 1024. To convert to megabytes (M), divide by 1024^2. To convert to gigabytes (G), divide by 1024^3:</p><p/><p> function humanReadableDiskSpace theUnits</p><p> set the caseSensitive to false</p><p> switch char 1 of theUnits</p><p> case "k"</p><p> return the diskSpace div 1024</p><p> break</p><p> case "m"</p><p> return the diskSpace div (1024^2)</p><p> break</p><p> case "g"</p><p> return the diskSpace div (1024^3)</p><p> break</p><p> default</p><p> return the diskSpace</p><p> break</p><p> end switch</p><p> end humanReadableDiskSpace</p>
</description>
</doc>