title: Error writing a file in Swift Playground
body: <p>Not sure why I am getting the error here. I created the folder 'Shared Playground Data' in documents as instructed. Does anyone have any insight?</p>
  
  <pre><code>import PlaygroundSupport
  import Foundation
  
  var fileName = "Csv.csv"
  var csvText = "Date,Task,Time Started,Time Ended\n"
  fileName.append(csvText)
  
  let fileUrl = playgroundSharedDataDirectory.appendingPathComponent(fileName)
  do {
  try fileName.write(to: fileUrl, atomically: true, encoding: .utf8)
  } catch {print("error")}
  </code></pre>