Skip to content
View in the app

A better way to browse. Learn more.

Tip.It Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Java File.length() vs File.getTotalSpace()

Featured Replies

Anyone know the difference between the two?

 

Also, if I wanted to make an exact copy of a file, would File.getTotalSpace() necessarily have to be the same between the copies, especially between different operating systems?

99 dungeoneering achieved, thanks to everyone that celebrated with me!

 

♪♪ Don't interrupt me as I struggle to complete this thought
Have some respect for someone more forgetful than yourself ♪♪

♪♪ And I'm not done
And I won't be till my head falls off ♪♪

[spoiler=length]length

public long length()Returns the length of the file denoted by this abstract pathname. The return value is unspecified if this pathname denotes a directory.

 

Returns:

The length, in bytes, of the file denoted by this abstract pathname, or 0L if the file does not exist. Some operating systems may return 0L for pathnames denoting system-dependent entities such as devices or pipes.

 

[spoiler=getTotalSpace]getTotalSpace

public long getTotalSpace()Returns the size of the partition named by this abstract pathname.

 

Returns:

The size, in bytes, of the partition or 0L if this abstract pathname does not name a partition

 

 

You Probably want to use length because from what I can tell getTotalSpace is for checking information on Drives (and possibly folders) Contained disk space.

Luna_pirate_signature.png

Thanks to DrCue at DeviantArt for the signature source

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.