# `GSPath saveToFile:format:context:error:`

*Instance Method*

Writes a Glyphs file representation.

## Declaration

```swift
func save(to file: UnsafeMutablePointer<FILE>, format formatVersion: GSFormatVersion, context: GSSaveContext?) throws
```

```objc
- (BOOL) saveToFile:(FILE *) file format:(GSFormatVersion) formatVersion context:(GSSaveContext *) context error:(NSError **) error;
```

```python
saveToFile_format_context_error_(file: FILE, formatVersion: GSFormatVersion, context: GSSaveContext) -> tuple[bool, NSError]
```

## Parameters

- `formatVersion` — The Glyphs file format version to write.
- `error` — On failure, an error describing why the path could not be written.

## Return Value

`YES` if the method succeeded, otherwise `NO`.

## Discussion

Returns `NO` when the path uses data that cannot be represented in the requested file format.

