从swift中的库(dylib)添加文件
我正在尝试创建一个动态库(Dylib),其中一些文件需要将其发送到Swift中的可执行过程中。为了创建可执行过程,我做到了:
func boot() {
let task = Process()
task.launchPath = "/bin/bash"
task.launchPath = Bundle.main.url(forResource: "boot", withExtension: "", subdirectory: "file/boot")?.path
task.arguments = ["-f"]
task.launch()
}
问题是,给予任务后(使用相关命令),如何将文件从动态库发送到该过程?我应该如何构建动态库以允许发送文件?
I'm trying to create a dynamic library (dylib) with some files inside that need to be sent in to an executable process in swift. To create the executable process I did this:
func boot() {
let task = Process()
task.launchPath = "/bin/bash"
task.launchPath = Bundle.main.url(forResource: "boot", withExtension: "", subdirectory: "file/boot")?.path
task.arguments = ["-f"]
task.launch()
}
The problem is that after giving the task.arguments (with the related command), how do I send a file from a dynamic library to the process? How should I possibly structure the dynamic library to allow sending a file?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论