Re: Mapping Write
- To: mathgroup at smc.vnet.net
- Subject: [mg43480] Re: Mapping Write
- From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
- Date: Thu, 18 Sep 2003 05:38:42 -0400 (EDT)
- Organization: Universitaet Leipzig
- References: <bk9jki$i$1@smc.vnet.net>
- Reply-to: kuska at informatik.uni-leipzig.de
- Sender: owner-wri-mathgroup at wolfram.com
Hi,
I suppose that you mean valid open output streams
and
Write @@@ Reverse /@ Transpose[{{x, y, z}, {xstream, ystream, zstream}}]
does what you probably want.
Regards
Jens
AES/newspost wrote:
>
> [This NG seems to have gone on an extended summer vacation, on my server
> anyway, just as I started a big project that's been stimulating lots of
> queries. Hope it's having a good time, and will be back soon.]
>
> I can successfully Map OpenWrite onto a list of file names, and also Map
> Close onto a list of streams; in particular
>
> Map[Close, Rest[ Rest[ Streams[] ] ] ]
>
> seems to be a good way to close all open streams except the two standard
> ones (though maybe it's risky to assume there are always just two such
> standard streams?).
>
> Is there a way to use Map to Write a list of variable values to a
> matching list of files, e.g., something like
>
> Map[ Write, {x,y,z}, {"xFile","yFile","zFile"} ]