title: NSFileSystemFreeSize returning inaccurate free disk space?
body: <p>So I'm trying to find the amount of free disk space on my iPhone and i've searched through several older post already. Most of these post utilizes NSFileManager to retrieve the NSFileSystemFreeSize value.</p>
  
  <p>However, it seems like the number from NSFileSystemFreeSize is inaccurate when compared to the number I see from my phone's settings>general>about>available.</p>
  
  <p>I get these following values:</p>
  
  <ul>
  <li>NSFileSystemFreeSize: 2287063040 (~2.28 GB)</li>
  <li>Phone's Available setting: 5.77 GB</li>
  <li>iTunes: 5.67 GB Free</li>
  </ul>
  
  <p>Code I used:</p>
  
  <pre><code>+ (NSString*)getFreeDiskspace
  {
  NSDictionary *atDict = [[NSFileManager defaultManager] attributesOfFileSystemForPath:@"/" error:NULL];
  unsigned freeSpace = [[atDict objectForKey:NSFileSystemFreeSize] unsignedIntValue];
  
  return [NSString stringWithFormat:@"%u", freeSpace];
  }
  </code></pre>
  
  <p>Other information:</p>
  
  <ul>
  <li>Phone used: iPhone 7</li>
  <li>OS Version 11.2.1</li>
  <li>Phone is plugged into macbook so that I can built via xCode directly</li>
  </ul>
  
  <p>Can anyone explain to me why NSFileSystemFreeSize doesnt match with the phone and iTunes? Any help is appreciated, thanks!</p>