D028868 CR1500 CR1100 CR2700 JavaScript Programming Guide User Manual Page 23 of 41
The Code Corporation
12393 South Gateway Park Place, Suite 600, Draper, UT 84020
+1 (801) 495-2200
FAX +1 (801) 495-0280
storage.defragment
storage.defragment gathers split or scattered file blocks into contiguous blocks, as much as
possible.
Example:
storage.defragment();
storage.findFirstInternal
The storage.findFirstInternal method finds the first file in the file system.
Example:
var name = storage.findFirstInternal();
storage.findNextInternal
The storage.findNextInternal method finds the next file in the file system after a
previous call to storage.findFirstInternal, storage.findFirst,
storage.findNextInternal, or storage.findNext.
Example:
var name = storage.findNextInternal();
storage.findFirst
The storage.findFirst method locates the first file, where the name matches a regular
expression specified in the call parameter.
Example:
var name = storage.findFirst(regex);
storage.findNext
The storage.findNext method locates the next file, where the name matches the
regular expression, specified in the expression parameter of a previous
storage.findFirst call. The matching names are not ordered, but they will not be
repeated; a findFirstNative - findNextNative sequence will return all matching files, provided
that there are no other intervening storage method calls. One can put the files into an array
and use JavaScript’s sort method when one needs them ordered.
Example:
var name = storage.findNext();
storage.size
The storage.size method returns the size of a file in bytes.
Example:
var fileSize = storage.size(“timeCard57);