---
title: "init(url:append:)"
framework: virtualization
role: symbol
role_heading: Initializer
path: "virtualization/vzfileserialportattachment/init(url:append:)-37g72"
---

# init(url:append:)

Creates a file-based serial port attachment object.

## Declaration

```swift
init(url: URL, append shouldAppend: Bool) throws
```

## Parameters

- `url`: The URL of a file on the local file system. The specified file must be writable by the virtual machine.
- `shouldAppend`: A Boolean that indicates whether the virtual machine opens the file in append mode. Specify doc://com.apple.documentation/documentation/Swift/true to append data to the file, and specify doc://com.apple.documentation/documentation/Swift/false to replace the contents of the file with any new data.

## Return Value

Return Value A file-based serial port attachment on success, or nil if initialization failed.
