You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`unlink` is deprecated on Windows, and `RemoveFileW` should be
preferred. However, that would limit the path to `MAX_PATH` (261)
characters. Prefer to use `FileManager to remove the file to avoid the
path limit.
Adopt the fileManager path in more locations.
Copy file name to clipboardExpand all lines: Sources/SWBUtil/FSProxy.swift
+4-150Lines changed: 4 additions & 150 deletions
Original file line number
Diff line number
Diff line change
@@ -362,7 +362,6 @@ class LocalFS: FSProxy, @unchecked Sendable {
362
362
/// Check whether a given path is a symlink.
363
363
/// - parameter destinationExists: If the path is a symlink, then this `inout` parameter will be set to `true` if the destination exists. Otherwise it will be set to `false`.
@@ -371,22 +370,6 @@ class LocalFS: FSProxy, @unchecked Sendable {
371
370
destinationExists =false
372
371
returnfalse
373
372
}
374
-
#else
375
-
destinationExists =false
376
-
varstatBuf=stat()
377
-
iflstat(path.str,&statBuf)<0{
378
-
returnfalse
379
-
}
380
-
guardcreateFileInfo(statBuf).isSymlink else{
381
-
returnfalse
382
-
}
383
-
statBuf =stat()
384
-
ifstat(path.str,&statBuf)<0{
385
-
returntrue
386
-
}
387
-
destinationExists =true
388
-
returntrue
389
-
#endif
390
373
}
391
374
392
375
func listdir(_ path:Path)throws->[String]{
@@ -397,70 +380,11 @@ class LocalFS: FSProxy, @unchecked Sendable {
397
380
/// - parameter recursive: If `false`, then the parent directory at `path` must already exist in order to create the directory. If it doesn't, then it will return without creating the directory (it will not throw an exception). If `true`, then the directory hierarchy of `path` will be created if possible.
0 commit comments