---
title: "init(bytesAllocated:itemAttributes:freeSpace:)"
framework: fskit
role: symbol
role_heading: Initializer
path: "fskit/fspreallocateresult/init(bytesallocated:itemattributes:freespace:)"
---

# init(bytesAllocated:itemAttributes:freeSpace:)

Creates a result for a preallocate operation.

## Declaration

```swift
init?(bytesAllocated: Int, itemAttributes attributes: FSItem.Attributes, freeSpace: FSFreeSpace?)
```

## Parameters

- `bytesAllocated`: The number of bytes actually allocated for the file during the preallocation operation.
- `attributes`: The updated doc://FSKit/documentation/FSKit/FSItem/Attributes of the file after the preallocation operation.
- `freeSpace`: An doc://FSKit/documentation/FSKit/FSFreeSpace instance populated with the volume’s updated free space. Passing a nil free space causes FSKit to calculate the free space when the operation is done, based on the volume’s doc://FSKit/documentation/FSKit/FSVolume/Handler/volumeStatistics property. This behavior may lead to degraded performance.

## Return Value

Return Value A populated result instance, or nil if validation fails.

## See Also

### Creating a preallocate result

- [FSItem.Attributes](fskit/fsitem/attributes.md)
- [FSFreeSpace](fskit/fsfreespace.md)
