Skip to content
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

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

stevapple
Copy link

@stevapple stevapple commented Jun 6, 2021

This PR intends to use SwiftSystem for file operations in TSCBasic, which are currently based on TSClibc.
It is based on #219 .

This will:

  • Simplify the implementation;
  • Make the code stronger and lot more “Swifty”;
  • Potentially improve the performance.

Discussion: Do we really need a buffer for I/O?

TBD: (mostly SwiftSystem side)

  • Pipe support;
  • Lock support;
  • Better FileDescriptor to FILE bridge.

]
},
"version": 1
}
Copy link
Contributor

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
Copy link
Contributor

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)!
Copy link
Contributor

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?

Copy link
Author

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.

@tomerd
Copy link
Contributor

tomerd commented Feb 2, 2022

@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

@tomerd tomerd added the wip Work in progress label Mar 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wip Work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants