Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

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

Search the Archive

Re: Re: Exporting data into a file, OpenWrite

  • To: mathgroup at smc.vnet.net
  • Subject: [mg96906] Re: [mg96879] Re: Exporting data into a file, OpenWrite
  • From: DrMajorBob <btreat1 at austin.rr.com>
  • Date: Fri, 27 Feb 2009 06:10:41 -0500 (EST)
  • References: <gnq6s2$87n$1@smc.vnet.net> <200902241044.FAA23505@smc.vnet.net>
  • Reply-to: drmajorbob at bigfoot.com

I use either ToFileName or a variant of the following, when I want to  
capture/create file or directory names:

{FileNameSetter[Dynamic@ts, "Directory"], Dynamic@ts}

I never, ever type in the file name by hand, so I never, ever get Windows  
and Mac conventions confused.

Bobby

On Thu, 26 Feb 2009 06:59:59 -0600, Albert Retey <awnl at gmx-topmail.de>  
wrote:

> peter wrote:
>> no double-slashes for me thank you very much - I've got a Mac.
>>
>> 2009/2/24 Sjoerd C. de Vries <sjoerd.c.devries at gmail.com>:
>>> Bill Rowe wrote
>>>
>>>> When you use Export, the file will be created in the current
>>>> working directory.
>>> I might add "...unless you include the full path to the file in the
>>> filename (using double slashes to separate directories and files, as a
>>> slash is used as an escape character in strings)"
>>>
>>> Cheers -- Sjoerd
>
> I think correctly you would call the character that you need to use on
> Windows a backslash (\) and that's the one you need to escape, because
> it is the escape character in Mathematica. On other systems you will
> need other characters for separating directories in pathes, which one is
>  held in the variable $PathnameSeparator. AFAIK on Windows in many
> places within Mathematica a single slash (/) will also work as a
> pathname separator in filenames. Probably you shouldn't rely on that but
> it's more convenient than the double backslash sometimes.
>
> An even better approach is to construct the filename with the function
> ToFileName, starting with one of the predefined directory variables you
> can find with
>
> Information["$*Directory*"]
>
>
> hth,
>
> albert
>



-- 
DrMajorBob at bigfoot.com


  • Prev by Date: Re: Galois resolvent
  • Next by Date: Re: newbie: diff equation
  • Previous by thread: Re: Exporting data into a file, OpenWrite
  • Next by thread: Re: Exporting data into a file, OpenWrite