equal
deleted
inserted
replaced
2263 !ExternalStream methodsFor:'instance release'! |
2263 !ExternalStream methodsFor:'instance release'! |
2264 |
2264 |
2265 closeFile |
2265 closeFile |
2266 "low level close - may be redefined in subclasses" |
2266 "low level close - may be redefined in subclasses" |
2267 |
2267 |
|
2268 |fp| |
|
2269 |
2268 %{ |
2270 %{ |
2269 OBJ fp; |
|
2270 |
|
2271 if ((fp = __INST(filePointer)) != nil) { |
2271 if ((fp = __INST(filePointer)) != nil) { |
2272 FILEPOINTER f; |
2272 FILEPOINTER f; |
2273 |
2273 |
2274 __INST(filePointer) = nil; |
2274 __INST(filePointer) = nil; |
2275 f = __FILEVal(fp); |
2275 f = __FILEVal(fp); |
2276 if (@global(ExternalStream:FileOpenTrace) == true) { |
2276 if (@global(ExternalStream:FileOpenTrace) == true) { |
2277 fprintf(stderr, "fclose [ExternalStream] %x\n", f); |
2277 fprintf(stderr, "fclose [ExternalStream] %x\n", f); |
2278 } |
2278 } |
2279 __BEGIN_INTERRUPTABLE__ |
2279 __BEGIN_INTERRUPTABLE__ |
2280 #ifdef WIN32 |
2280 #ifdef WIN32 |
2281 __STX_C_CALL1((void*)fclose, (void*)f); |
2281 __STX_C_CALL1((void*)fclose, (void*)f); |
2282 #else |
2282 #else |
2283 fclose(f); |
2283 fclose(f); |
2284 #endif |
2284 #endif |
2285 __END_INTERRUPTABLE__ |
2285 __END_INTERRUPTABLE__ |
2286 } |
2286 } |
2287 %} |
2287 RETURN (self); |
|
2288 %}. |
|
2289 "/ fallback for rel5 |
|
2290 |
|
2291 fp := filePointer. |
|
2292 fp notNil ifTrue:[ |
|
2293 filePointer := nil. |
|
2294 self closeFile:fp |
|
2295 ] |
|
2296 ! |
|
2297 |
|
2298 closeFile:filePointer |
|
2299 "for rel5 only" |
|
2300 |
|
2301 self primitiveFailed |
|
2302 |
|
2303 |
|
2304 |
|
2305 |
|
2306 |
|
2307 |
|
2308 |
2288 ! |
2309 ! |
2289 |
2310 |
2290 disposed |
2311 disposed |
2291 "some Stream has been collected - close the file if not already done" |
2312 "some Stream has been collected - close the file if not already done" |
2292 |
2313 |
5617 ! ! |
5638 ! ! |
5618 |
5639 |
5619 !ExternalStream class methodsFor:'documentation'! |
5640 !ExternalStream class methodsFor:'documentation'! |
5620 |
5641 |
5621 version |
5642 version |
5622 ^ '$Header: /cvs/stx/stx/libbasic/ExternalStream.st,v 1.218 2000-07-03 13:07:40 cg Exp $' |
5643 ^ '$Header: /cvs/stx/stx/libbasic/ExternalStream.st,v 1.219 2000-08-02 23:10:29 cg Exp $' |
5623 ! ! |
5644 ! ! |
5624 ExternalStream initialize! |
5645 ExternalStream initialize! |