---
title: "write(to:)"
framework: createml
role: symbol
role_heading: Instance Method
path: "createml/mldatatable/write(to:)"
---

# write(to:)

Exports a binary file of the data table to the given directory URL.

## Declaration

```swift
func write(to directoryURL: URL) throws
```

## Parameters

- `directoryURL`: The directory location in the file system to which the data table file should be written.

## See Also

### Saving a data table

- [write(toDirectory:)](createml/mldatatable/write(todirectory:).md)
- [writeCSV(to:)](createml/mldatatable/writecsv(to:).md)
- [writeCSV(toFile:)](createml/mldatatable/writecsv(tofile:).md)
