File tree 1 file changed +12
-12
lines changed
1 file changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -269,20 +269,20 @@ extension FileManager {
269
269
}
270
270
}
271
271
272
- try FileManager . default. _fileSystemRepresentation ( withPath: path) { fsr in
273
- var saAttributes : SECURITY_ATTRIBUTES =
274
- SECURITY_ATTRIBUTES ( nLength: DWORD ( MemoryLayout< SECURITY_ATTRIBUTES> . size) ,
275
- lpSecurityDescriptor: nil ,
276
- bInheritHandle: false )
277
- try withUnsafeMutablePointer ( to: & saAttributes) {
278
- if !CreateDirectoryW( fsr, $0) {
279
- throw _NSErrorWithWindowsError ( GetLastError ( ) , reading: false , paths: [ path] )
272
+ try withNTPathRepresentation ( of: path) { wszPath in
273
+ var saAttributes : SECURITY_ATTRIBUTES =
274
+ SECURITY_ATTRIBUTES ( nLength: DWORD ( MemoryLayout< SECURITY_ATTRIBUTES> . size) ,
275
+ lpSecurityDescriptor: nil ,
276
+ bInheritHandle: false )
277
+ try withUnsafeMutablePointer ( to: & saAttributes) { pSecurityAttributes in
278
+ guard CreateDirectoryW ( wszPath, pSecurityAttributes) else {
279
+ throw _NSErrorWithWindowsError ( GetLastError ( ) , reading: false , paths: [ path] )
280
+ }
280
281
}
281
- }
282
+ }
282
283
283
- if let attr = attributes {
284
- try self . setAttributes ( attr, ofItemAtPath: path)
285
- }
284
+ if let attributes {
285
+ try self . setAttributes ( attributes, ofItemAtPath: path)
286
286
}
287
287
}
288
288
You can’t perform that action at this time.
0 commit comments