comparison file.rhope @ 82:2e2e55fc12f9

Fix bug with conditionally assigning a literal or input to a named pipe
author Mike Pavone <pavone@retrodev.com>
date Tue, 27 Jul 2010 15:23:32 -0400
parents dbe95bfec970
children f51c4c17457c
comparison
equal deleted inserted replaced
81:dbe95bfec970 82:2e2e55fc12f9
77 77
78 Open@File[file,mode:out,error] 78 Open@File[file,mode:out,error]
79 { 79 {
80 If[[mode]=["r"]] 80 If[[mode]=["r"]]
81 { 81 {
82 imode <- Val[0i32] 82 imode <- 0i32
83 type <- Val[File Read()] 83 type <- File Read()
84 out <- Val[ofile] 84 out <- Val[ofile]
85 }{ 85 }{
86 If[[mode]=["w"]] 86 If[[mode]=["w"]]
87 { 87 {
88 imode <- Val[65i32] 88 imode <- 65i32
89 type <- Val[File Write()] 89 type <- File Write()
90 out <- Val[ofile] 90 out <- Val[ofile]
91 If[[fd]!=[-1i32]] 91 If[[fd]!=[-1i32]]
92 { lseek[fd, 0i64, 2i32] } 92 { lseek[fd, 0i64, 2i32] }
93 }{ 93 }{
94 ,error <- If[[mode]=["rw"]] 94 ,error <- If[[mode]=["rw"]]
95 { 95 {
96 imode <- Val[66i32] 96 imode <- 66i32
97 type <- Val[File ReadWrite()] 97 type <- File ReadWrite()
98 out <- [ofile]Read Offset <<[0i64] 98 out <- [ofile]Read Offset <<[0i64]
99 } 99 }
100 } 100 }
101 } 101 }
102 fd <- open[[[[file]Name >>]Flatten]Buffer >>, imode, 438u32] 102 fd <- open[[[[file]Name >>]Flatten]Buffer >>, imode, 438u32]