B2G/gecko/b2g/components/DirectoryProvider.js
// The VolumeService only exists on the device, and not on desktop
The VolumeService only exists on the device, and not on desktop
The VolumeService only exists on the device and not on desktop
function dp_volumeHasFreeSpace(volumePath, requiredSpace) {
    if (!volumePath) {
      return false;
    }
    if (!Services.volumeService) {
      return false;
    }
    let volume = Services.volumeService.createOrGetVolumeByPath(volumePath);
    if (!volume || volume.state !== Ci.nsIVolume.STATE_MOUNTED) {
      return false;
    }
    let stat = volume.getStats();
    if (!stat) {
      return false;
    }
    return requiredSpace <= stat.freeBytes;
  }
function dp_volumeHasFreeSpace ( volumePath , requiredSpace ) { if ( ! volumePath ) { return false ; } if ( ! Services . volumeService ) { return false ; } let volume = Services . volumeService . createOrGetVolumeByPath ( volumePath ) ; if ( ! volume || volume . state !== Ci . nsIVolume . STATE_MOUNTED ) { return false ; } let stat = volume . getStats ( ) ; if ( ! stat ) { return false ; } return requiredSpace <= stat . freeBytes ; }
The VolumeService only exists on the device, and not on desktop
The VolumeService only exists on the device and not on desktop