/** * Returns the total size in bytes of the partition containing this path. * Returns 0 if this path does not exist. * * @since 1.6 */ public long getTotalSpace() { try { StructStatVfs sb = Libcore.os.statvfs(path); return sb.f_blocks * sb.f_bsize; // total block count * block size in bytes. } catch (ErrnoException errnoException) { return 0; } }
public StructStatVfs statvfs(String path) throws ErrnoException { return os.statvfs(path); } public String strerror(int errno) { return os.strerror(errno); }
/** * Returns the number of free bytes on the partition containing this path. * Returns 0 if this path does not exist. * * <p>Note that this is likely to be an optimistic over-estimate and should not * be taken as a guarantee your application can actually write this many bytes. * * @since 1.6 */ public long getFreeSpace() { try { StructStatVfs sb = Libcore.os.statvfs(path); return sb.f_bfree * sb.f_bsize; // free block count * block size in bytes. } catch (ErrnoException errnoException) { return 0; } } }
/** * Returns the number of usable free bytes on the partition containing this path. * Returns 0 if this path does not exist. * * <p>Note that this is likely to be an optimistic over-estimate and should not * be taken as a guarantee your application can actually write this many bytes. * On Android (and other Unix-based systems), this method returns the number of free bytes * available to non-root users, regardless of whether you're actually running as root, * and regardless of any quota or other restrictions that might apply to the user. * (The {@code getFreeSpace} method returns the number of bytes potentially available to root.) * * @since 1.6 */ public long getUsableSpace() { try { StructStatVfs sb = Libcore.os.statvfs(path); return sb.f_bavail * sb.f_bsize; // non-root free block count * block size in bytes. } catch (ErrnoException errnoException) { return 0; } }
/** * Returns the total size in bytes of the partition containing this path. * Returns 0 if this path does not exist. * * @since 1.6 */ public long getTotalSpace() { try { StructStatVfs sb = Libcore.os.statvfs(path); return sb.f_blocks * sb.f_bsize; // total block count * block size in bytes. } catch (ErrnoException errnoException) { return 0; } }
/** * Returns the total size in bytes of the partition containing this path. * Returns 0 if this path does not exist. * * @since 1.6 */ public long getTotalSpace() { try { StructStatVfs sb = Libcore.os.statvfs(path); return sb.f_blocks * sb.f_bsize; // total block count * block size in bytes. } catch (ErrnoException errnoException) { return 0; } }
/** * Returns the total size in bytes of the partition containing this path. * Returns 0 if this path does not exist. * * @since 1.6 */ public long getTotalSpace() { try { StructStatVfs sb = Libcore.os.statvfs(path); return sb.f_blocks * sb.f_bsize; // total block count * block size in bytes. } catch (ErrnoException errnoException) { return 0; } }
/** * Returns the total size in bytes of the partition containing this path. * Returns 0 if this path does not exist. * * @since 1.6 */ public long getTotalSpace() { try { StructStatVfs sb = Libcore.os.statvfs(path); return sb.f_blocks * sb.f_bsize; // total block count * block size in bytes. } catch (ErrnoException errnoException) { return 0; } }
public StructStatVfs statvfs(String path) throws ErrnoException { return os.statvfs(path); } public String strerror(int errno) { return os.strerror(errno); }
/** * Returns the total size in bytes of the partition containing this path. * Returns 0 if this path does not exist. * * @since 1.6 */ public long getTotalSpace() { try { StructStatVfs sb = Libcore.os.statvfs(path); return sb.f_blocks * sb.f_bsize; // total block count * block size in bytes. } catch (ErrnoException errnoException) { return 0; } }
public StructStatVfs statvfs(String path) throws ErrnoException { return os.statvfs(path); } public String strerror(int errno) { return os.strerror(errno); }
/** * Returns the total size in bytes of the partition containing this path. * Returns 0 if this path does not exist. * * @since 1.6 */ public long getTotalSpace() { try { StructStatVfs sb = Libcore.os.statvfs(path); return sb.f_blocks * sb.f_bsize; // total block count * block size in bytes. } catch (ErrnoException errnoException) { return 0; } }
public StructStatVfs statvfs(String path) throws ErrnoException { return os.statvfs(path); } public String strerror(int errno) { return os.strerror(errno); }
public StructStatVfs statvfs(String path) throws ErrnoException { return os.statvfs(path); } public String strerror(int errno) { return os.strerror(errno); }
/** * Returns the number of free bytes on the partition containing this path. * Returns 0 if this path does not exist. * * <p>Note that this is likely to be an optimistic over-estimate and should not * be taken as a guarantee your application can actually write this many bytes. * * @since 1.6 */ public long getFreeSpace() { try { StructStatVfs sb = Libcore.os.statvfs(path); return sb.f_bfree * sb.f_bsize; // free block count * block size in bytes. } catch (ErrnoException errnoException) { return 0; } } }
public StructStatVfs statvfs(String path) throws ErrnoException { return os.statvfs(path); } public String strerror(int errno) { return os.strerror(errno); }
public StructStatVfs statvfs(String path) throws ErrnoException { return os.statvfs(path); } public String strerror(int errno) { return os.strerror(errno); }
/** * Returns the number of free bytes on the partition containing this path. * Returns 0 if this path does not exist. * * <p>Note that this is likely to be an optimistic over-estimate and should not * be taken as a guarantee your application can actually write this many bytes. * * @since 1.6 */ public long getFreeSpace() { try { StructStatVfs sb = Libcore.os.statvfs(path); return sb.f_bfree * sb.f_bsize; // free block count * block size in bytes. } catch (ErrnoException errnoException) { return 0; } } }
/** * Returns the number of free bytes on the partition containing this path. * Returns 0 if this path does not exist. * * <p>Note that this is likely to be an optimistic over-estimate and should not * be taken as a guarantee your application can actually write this many bytes. * * @since 1.6 */ public long getFreeSpace() { try { StructStatVfs sb = Libcore.os.statvfs(path); return sb.f_bfree * sb.f_bsize; // free block count * block size in bytes. } catch (ErrnoException errnoException) { return 0; } } }
/** * Returns the number of free bytes on the partition containing this path. * Returns 0 if this path does not exist. * * <p>Note that this is likely to be an optimistic over-estimate and should not * be taken as a guarantee your application can actually write this many bytes. * * @since 1.6 */ public long getFreeSpace() { try { StructStatVfs sb = Libcore.os.statvfs(path); return sb.f_bfree * sb.f_bsize; // free block count * block size in bytes. } catch (ErrnoException errnoException) { return 0; } } }