Re: Testing if a file (or stream) has been opened? (again)
- To: mathgroup at smc.vnet.net
- Subject: [mg43476] Re: Testing if a file (or stream) has been opened? (again)
- From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
- Date: Thu, 18 Sep 2003 05:38:39 -0400 (EDT)
- Organization: Universitaet Leipzig
- References: <bk9ivl$t6c$1@smc.vnet.net>
- Reply-to: kuska at informatik.uni-leipzig.de
- Sender: owner-wri-mathgroup at wolfram.com
Hi, MemberQ[First /@ Streams[], "testFile"] ?? Regards Jens AES/newspost wrote: > > Is there a way to accomplish something like the following and get the > desired answer from MemberQ? (Or an alternative approach > > OpenWrite["testFile"] > > OutputStream["testFile", 21] > > openStreams = Streams[] > > {OutputStream["stdout", 1], > OutputStream["stderr", 2], > OutputStream["testFile", 21]} > > openStreams[[3]] > > OutputStream["testFile", 21] > > openStreams[[3, 1]] > > "testFile" > > MemberQ[openStreams, testFile] > > False > > MemberQ[openStreams, "testFile"] > > False