---
title: "packEntry(name:itemType:itemID:nextCookie:attributes:)"
framework: fskit
role: symbol
role_heading: Instance Method
path: "fskit/fsdirectoryentrypacker/packentry(name:itemtype:itemid:nextcookie:attributes:)"
---

# packEntry(name:itemType:itemID:nextCookie:attributes:)

Provides a directory entry during enumeration.

## Declaration

```swift
func packEntry(name: FSFileName, itemType: FSItem.ItemType, itemID: FSItem.Identifier, nextCookie: FSDirectoryCookie, attributes: FSItem.Attributes?) -> Bool
```

## Parameters

- `name`: The item’s name.
- `itemType`: The type of the item.
- `itemID`: The item’s identifier. Typically this is an inode number, or one of the constants defined by doc://FSKit/documentation/FSKit/FSItem/Identifier like doc://FSKit/documentation/FSKit/FSItem/Identifier/rootDirectory.
- `nextCookie`: A value to indicate the next entry in the directory to enumerate. FSKit passes this value as the cookie parameter on the next call to doc://FSKit/documentation/FSKit/FSVolume/Handler/enumerateDirectory(_:startingAt:verifier:attributes:packer:context:replyHandler:). Use whatever value is appropriate for your implementation; the value is opaque to FSKit.
- `attributes`: The item’s attributes. Pass nil if the enumeration call didn’t request attributes.

## Return Value

Return Value true (Swift) or YES (Objective-C) if packing was successful and enumeration can continue with the next directory entry. If the value is false (Swift) or NO (Objective-C), stop enumerating. This result can happen when the entry is too big for the remaining space in the buffer.

## Discussion

Discussion You call this method in your implementation of enumerateDirectory(_:startingAt:verifier:attributes:packer:context:replyHandler:), for each directory entry you want to provide to the enumeration.

## See Also

### Packing entries

- [FSItem.ItemType](fskit/fsitem/itemtype.md)
- [FSItem.Identifier](fskit/fsitem/identifier.md)
- [FSDirectoryCookie](fskit/fsdirectorycookie.md)
- [FSDirectoryCookie](fskit/fsdirectorycookie.md)
- [FSItem.Attributes](fskit/fsitem/attributes.md)
