<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 8.0.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/URLResourceValues/totalFileAllocatedSize",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "s:10Foundation17URLResourceValuesV22totalFileAllocatedSizeSiSgvp"
  },
  "title" : "totalFileAllocatedSize"
}
-->

# totalFileAllocatedSize

The total allocated size of the file, in bytes.

```
var totalFileAllocatedSize: Int? { get }
```

## Discussion

The property returns `nil` if the information isn’t available. The allocated size in bytes may include space that metadata uses. This can be less than the value that [`totalFileSize`](/documentation/Foundation/URLResourceValues/totalFileSize) returns after if it’s a compressed resource.

> Note:
> This only applies to regular files.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)