# CreateFile
<span class="source-link">[[Source]](src/files/file.md#L49)</span>

Open a File for read/write, creating if it doesn't exist, preserving the
contents if it does exist.


```pony
primitive val CreateFile
```

## Constructors

### create
<span class="source-link">[[Source]](src/files/file.md#L49)</span>


```pony
new val create()
: CreateFile val^
```

#### Returns

* [CreateFile](files-CreateFile) val^

---

## Public Functions

### apply
<span class="source-link">[[Source]](src/files/file.md#L54)</span>


```pony
fun box apply(
  from: FilePath val)
: (File ref | FileOK val | FileError val | 
    FileEOF val | FileBadFileNumber val | FileExists val | 
    FilePermissionDenied val)
```
#### Parameters

*   from: [FilePath](files-FilePath) val

#### Returns

* ([File](files-File) ref | [FileOK](files-FileOK) val | [FileError](files-FileError) val | 
    [FileEOF](files-FileEOF) val | [FileBadFileNumber](files-FileBadFileNumber) val | [FileExists](files-FileExists) val | 
    [FilePermissionDenied](files-FilePermissionDenied) val)

---

### eq
<span class="source-link">[[Source]](src/files/file.md#L54)</span>


```pony
fun box eq(
  that: CreateFile val)
: Bool val
```
#### Parameters

*   that: [CreateFile](files-CreateFile) val

#### Returns

* [Bool](builtin-Bool) val

---

### ne
<span class="source-link">[[Source]](src/files/file.md#L54)</span>


```pony
fun box ne(
  that: CreateFile val)
: Bool val
```
#### Parameters

*   that: [CreateFile](files-CreateFile) val

#### Returns

* [Bool](builtin-Bool) val

---

