File tree Expand file tree Collapse file tree 1 file changed +5
-13
lines changed Expand file tree Collapse file tree 1 file changed +5
-13
lines changed Original file line number Diff line number Diff line change @@ -367,9 +367,9 @@ extension FileHandle {
367
367
}
368
368
369
369
open class Pipe : NSObject {
370
- private let readHandle : FileHandle
371
- private let writeHandle : FileHandle
372
-
370
+ open let fileHandleForReading : FileHandle
371
+ open let fileHandleForWriting : FileHandle
372
+
373
373
public override init ( ) {
374
374
/// the `pipe` system call creates two `fd` in a malloc'ed area
375
375
var fds = UnsafeMutablePointer< Int32> . allocate( capacity: 2 )
@@ -383,19 +383,11 @@ open class Pipe: NSObject {
383
383
/// don't need to add a `deinit` to this class
384
384
385
385
/// Create the read handle from the first fd in `fds`
386
- self . readHandle = FileHandle ( fileDescriptor: fds. pointee, closeOnDealloc: true )
386
+ self . fileHandleForReading = FileHandle ( fileDescriptor: fds. pointee, closeOnDealloc: true )
387
387
388
388
/// Advance `fds` by one to create the write handle from the second fd
389
- self . writeHandle = FileHandle ( fileDescriptor: fds. successor ( ) . pointee, closeOnDealloc: true )
389
+ self . fileHandleForWriting = FileHandle ( fileDescriptor: fds. successor ( ) . pointee, closeOnDealloc: true )
390
390
391
391
super. init ( )
392
392
}
393
-
394
- open var fileHandleForReading : FileHandle {
395
- return self . readHandle
396
- }
397
-
398
- open var fileHandleForWriting : FileHandle {
399
- return self . writeHandle
400
- }
401
393
}
You can’t perform that action at this time.
0 commit comments