@@ -31,7 +31,7 @@ class FileIO {
3131 }
3232
3333 func loadFrom( _ url: URL ) throws -> Data ? {
34- return self . fileManager. contents ( atPath: url. absoluteString )
34+ return self . fileManager. contents ( atPath: url. relativePath )
3535 }
3636
3737 func readLines( from url: URL ) throws -> [ Data ] {
@@ -74,21 +74,21 @@ class FileIO {
7474 }
7575
7676 func fileExists( _ url: URL ) -> Bool {
77- return self . fileManager. fileExists ( atPath: url. absoluteString )
77+ return self . fileManager. fileExists ( atPath: url. relativePath )
7878 }
7979
8080 func createIfAbsent( at name: URL , isDirectory: Bool ) throws {
8181 if isDirectory {
82- try self . fileManager. createDirectory ( at : name, withIntermediateDirectories: true )
82+ try self . fileManager. createDirectory ( atPath : name. relativePath , withIntermediateDirectories: true )
8383 } else {
8484 // file
85- self . fileManager. createFile ( atPath: name. absoluteString , contents: nil )
85+ self . fileManager. createFile ( atPath: name. relativePath , contents: nil )
8686 }
8787 }
8888
8989 func attributesOf( _ fileURL: URL ) throws -> [ FileAttributeKey : Any ] {
9090 if self . fileExists ( fileURL) {
91- return try self . fileManager. attributesOfItem ( atPath: fileURL. absoluteString )
91+ return try self . fileManager. attributesOfItem ( atPath: fileURL. relativePath )
9292 }
9393
9494 return [ FileAttributeKey . size: 0 ]
@@ -99,6 +99,6 @@ class FileIO {
9999 }
100100
101101 func remove( at fileURL: URL ) throws {
102- try self . fileManager. removeItem ( atPath: fileURL. absoluteString )
102+ try self . fileManager. removeItem ( atPath: fileURL. relativePath )
103103 }
104104}
0 commit comments