-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Experimental][DNM] Use SwiftSystem for file operations #221
base: main
Are you sure you want to change the base?
Conversation
] | ||
}, | ||
"version": 1 | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove this file
default: | ||
self.init(.unknownOSError, path) | ||
case .permissionDenied: return .invalidAccess | ||
case .isDirectory: return.isDirectory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing space?
#endif | ||
filepath.root = base.filepath.root | ||
|
||
let commonAncestor = AbsolutePath(filepath).lowestCommonAncestor(with: base)! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
guard + precondition instead of bang?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don’t think callers should guard such condition🤔 Breaking is quite reasonable and necessary here.
We’d better discuss in #219 since this API change is introduced there.
@stevapple @compnerd we now have swift-system integrated into the main branch of TSC and can start making use of it / reduce code to help support windows paths etc better |
This PR intends to use
SwiftSystem
for file operations inTSCBasic
, which are currently based onTSClibc
.It is based on #219 .
This will:
Discussion: Do we really need a buffer for I/O?
TBD: (mostly
SwiftSystem
side)FileDescriptor
toFILE
bridge.