MathGroup Archive 2003

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Testing if a file (or stream) has been opened? (again)

  • To: mathgroup at smc.vnet.net
  • Subject: [mg43514] Re: Testing if a file (or stream) has been opened? (again)
  • From: Bill Rowe <listuser at earthlink.net>
  • Date: Thu, 18 Sep 2003 05:40:13 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

On 9/17/03 at 7:58 AM, siegman at stanford.edu (AES/newspost) wrote:

> Is there a way to accomplish something like the following and get the 
> desired answer from MemberQ?  (Or an alternative approach

How about

In[1]:=
str=OpenWrite["test file"];
MemberQ[First/@Streams[],"test file"]

Out[2]=
True

It is useful to keep in mind virtually everthing in Mathematica can be viewed as an expression with parts and commands like First not only select parts of a list but also select parts of an expression.


  • Prev by Date: question
  • Next by Date: ODE integration via Mathlink
  • Previous by thread: Testing if a file (or stream) has been opened? (again)
  • Next by thread: Re: Testing if a file (or stream) has been opened? (again)