diff -r 913c9751c067 -r 716254ccbcc0 org.symbian.tools.wrttools.doc.WebDeveloper/html/GUID-0A0DE525-723F-45BD-9F10-76AAB4616426.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/org.symbian.tools.wrttools.doc.WebDeveloper/html/GUID-0A0DE525-723F-45BD-9F10-76AAB4616426.html Fri Mar 05 19:11:15 2010 -0800 @@ -0,0 +1,37 @@ + + +drivefree()

drivefree()

+

Syntax:

+
[int] sysinfo.drivefree(String drivename)
+

Description:

+

The drivefree method can be used to detect the space available for memory storage on a device.

+

Argument:

+
    +
  • drivename:

    + +

    Specifies the name of a drive to be examined.

    + +
  • +
+

Return value:

+

If the drive exists, this method returns an integer value indicating the available space on the specified drive, measured in bytes.

+

Example code:

+
function checkDrivesInformation() {
+  var space = 0;
+  // get existing user's drives
+  var allDrives = sysinfo.drivelist;
+  var drives = allDrives.split(" ");
+  // read and print all drives’ name and information
+  for (var i=0; i<drives.length; i++) {
+     space = sysinfo.drivesize(drives[i]);
+     space /=1024; // convert from bytes to kB
+     alert("Total space of drive "+drives[i]+" ="+space+"kB";
+     space = sysinfo.drivefree(drives[i]);
+     space /=1024; // convert from bytes to kB
+     alert("Free space of drive "+drives[i]+" ="+space+"kB";
+     }
+  }
+
\ No newline at end of file