@@ -114,6 +114,7 @@ open class Process: NSObject {
114114 static var done = false
115115 static let lock = NSLock ( )
116116 }
117+
117118 Once . lock. synchronized {
118119 if !Once. done {
119120 let thread = Thread {
@@ -164,26 +165,52 @@ open class Process: NSObject {
164165
165166 }
166167
167- // these methods can only be set before a launch
168+ // These methods can only be set before a launch.
169+
168170 open var launchPath : String ?
169171 open var arguments : [ String ] ?
170172 open var environment : [ String : String ] ? // if not set, use current
171173
172174 open var currentDirectoryPath : String = FileManager . default. currentDirectoryPath
173175
174- // standard I/O channels; could be either a FileHandle or a Pipe
176+ open var executableURL : URL ? {
177+ get {
178+ guard let launchPath = self . launchPath else {
179+ return nil
180+ }
181+
182+ return URL ( fileURLWithPath: launchPath)
183+ }
184+ set {
185+ self . launchPath = newValue? . path
186+ }
187+ }
188+
189+ open var currentDirectoryURL : URL {
190+ get {
191+ return URL ( fileURLWithPath: self . currentDirectoryPath)
192+ }
193+ set {
194+ self . currentDirectoryPath = newValue. path
195+ }
196+ }
197+
198+ // Standard I/O channels; could be either a FileHandle or a Pipe
199+
175200 open var standardInput : Any ? {
176201 willSet {
177202 precondition ( newValue is Pipe || newValue is FileHandle ,
178203 " standardInput must be either Pipe or FileHandle " )
179204 }
180205 }
206+
181207 open var standardOutput : Any ? {
182208 willSet {
183209 precondition ( newValue is Pipe || newValue is FileHandle ,
184210 " standardOutput must be either Pipe or FileHandle " )
185211 }
186212 }
213+
187214 open var standardError : Any ? {
188215 willSet {
189216 precondition ( newValue is Pipe || newValue is FileHandle ,
@@ -198,7 +225,8 @@ open class Process: NSObject {
198225
199226 private var processLaunchedCondition = NSCondition ( )
200227
201- // actions
228+ // Actions
229+
202230 open func launch( ) {
203231
204232 self . processLaunchedCondition. lock ( )
0 commit comments