Skip to content

Crash in File.write #2

@radianttap

Description

@radianttap

I just got this crash report.

Image

I assume it's this closure u in File.swift file

  private func write(_ text: String?) -> String? {
    if let str = text, !str.isEmpty {
      queue.async {
        if let data = (str + "\n").data(using: .utf8) {
          self.file?.write(data)
        }
      }
    }
    return text
  }

The docs say

This method raises fileHandleOperationException if the file descriptor is closed or isn’t valid, if the handle represents an unconnected pipe or socket endpoint, if there isn’t any free space on the file system, or if any other writing error occurs.

Any ideas how to fix this..?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions