JohnSundell / Files

A nicer way to handle files & folders in Swift
MIT License
2.53k stars 182 forks source link

Create exists file/folder should throw error #133

Open honghaoz opened 2 years ago

honghaoz commented 2 years ago

To match the documentation of createSubfolder and createFile methods on

This method throws an error if a folder already exists at the given path.
This method throws an error if a file already exists at the given path.

It should throw error if file/folder exits.

The reason is when withIntermediateDirectories is set to true for createDirectory(atPath:withIntermediateDirectories:attributes:), the FileManager doesn't throw error if path exists.