---
title: "CFURLWriteBookmarkDataToFile(_:_:_:_:)"
framework: corefoundation
role: symbol
role_heading: Function
path: "corefoundation/cfurlwritebookmarkdatatofile(_:_:_:_:)"
---

# CFURLWriteBookmarkDataToFile(_:_:_:_:)

Creates an alias file on disk at a specified location with specified bookmark data.

## Declaration

```swift
func CFURLWriteBookmarkDataToFile(_ bookmarkRef: CFData!, _ fileURL: CFURL!, _ options: CFURLBookmarkFileCreationOptions, _ errorRef: UnsafeMutablePointer<Unmanaged<CFError>?>!) -> Bool
```

## Parameters

- `bookmarkRef`: The bookmark data containing information for the alias file.
- `fileURL`: The desired location of the alias file.
- `options`: Options taken into account when creating the alias file.
- `errorRef`: The error that occurred in the case that the alias file cannot be created.

## Return Value

Return Value true if the alias file is successfully created; otherwise, false.

## See Also

### Working with Bookmark Data

- [CFURLCreateBookmarkData(_:_:_:_:_:_:)](corefoundation/cfurlcreatebookmarkdata(_:_:_:_:_:_:).md)
- [CFURLCreateBookmarkDataFromAliasRecord(_:_:)](corefoundation/cfurlcreatebookmarkdatafromaliasrecord(_:_:).md)
- [CFURLCreateBookmarkDataFromFile(_:_:_:)](corefoundation/cfurlcreatebookmarkdatafromfile(_:_:_:).md)
- [CFURLStartAccessingSecurityScopedResource(_:)](corefoundation/cfurlstartaccessingsecurityscopedresource(_:).md)
- [CFURLStopAccessingSecurityScopedResource(_:)](corefoundation/cfurlstopaccessingsecurityscopedresource(_:).md)
