Home THE HYPERCARD CENTER

HyperTalk Reference
Home » HyperTalk Reference » Functions

Note: This is a work in progress and will be formatting errors. Read more about the project on the home page.

diskSpace

the diskSpace [of disk diskName]
Value returned: a positive integer equal to the number of bytes of free space on the disk that contains the current stack or of the disk whose name appears in diskName (assuming diskName is a mounted volume).


Examples

if (the diskSpace div 1024) < 5000 then
   answer "Your disk is getting full."  
end if

if diskSpace of disk "Outside" > size of this stack then do fld 5 

get the diskSpace of disk "Major Projects"

Demo Script

on reportDiskSpace
   set the numberFormat to "0.0"
   answer "The amount of space left on the disk named" && diskName() && ¬
   "is" && the diskSpace / 1024000 && "megabytes."
 end reportDiskSpace
 

 function diskName longStackName
   if longStackName is empty
   then put the long name of this stack into longStackName
   delete char 1 to 7 of longStackName -- remove “stack "”
   return char 1 to offset(":",longStackName) - 1 of longStackName
 end diskName

Placeholders

Related Topics

« destination | HyperTalk Reference | exp, exp1, exp2 »


Version 0.7b1 (March 24, 2022)

Made with Macintosh

Switch to Modern View

Home
The HyperCard Center
HyperTalk Reference
Home » HyperTalk Reference » Functions

Note: This is a work in progress and will be formatting errors. Read more about the project on the home page.

diskSpace

the diskSpace [of disk diskName]
Value returned: a positive integer equal to the number of bytes of free space on the disk that contains the current stack or of the disk whose name appears in diskName (assuming diskName is a mounted volume).


Examples

if (the diskSpace div 1024) < 5000 then
   answer "Your disk is getting full."  
end if

if diskSpace of disk "Outside" > size of this stack then do fld 5 

get the diskSpace of disk "Major Projects"

Demo Script

on reportDiskSpace
   set the numberFormat to "0.0"
   answer "The amount of space left on the disk named" && diskName() && ¬
   "is" && the diskSpace / 1024000 && "megabytes."
 end reportDiskSpace
 

 function diskName longStackName
   if longStackName is empty
   then put the long name of this stack into longStackName
   delete char 1 to 7 of longStackName -- remove “stack "”
   return char 1 to offset(":",longStackName) - 1 of longStackName
 end diskName

Placeholders

Related Topics

« destination | HyperTalk Reference | exp, exp1, exp2 »

Version 0.7b1 (March 24, 2022)

Made with Macintosh

Switch to Retro View