MathGroup Archive 2003

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

Search the Archive

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

  • To: mathgroup at smc.vnet.net
  • Subject: [mg43438] Testing if a file (or stream) has been opened? (again)
  • From: AES/newspost <siegman at stanford.edu>
  • Date: Wed, 17 Sep 2003 07:58:54 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

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


  • Prev by Date: FileBrowse command
  • Next by Date: Nonlinear Fitting in Mathematica 4
  • Previous by thread: Re: FileBrowse command
  • Next by thread: Re: Testing if a file (or stream) has been opened? (again)