------art_26585_12141239.1129982580752
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

now i have another question, is it possible to create a new directory,
because when i try that with File.open("./newdir/file.html", 'w') it gives
me an error.
so is it possible?
Dirk.

 2005/10/22, Brian Schröäer <ruby.brian / gmail.com>:
>
> On 21/10/05, daz <dooby / d10.karoo.co.uk> wrote:
> >
> > Dirk Meijer wrote:
> > > hi everyone, i've got a noobish question..
> > > is there a way to create a new file (html in this case)
> > > and write stuff into it?
> > > there probably is..
> > > i'm using Ruby 1.8.2 under windows xp
> > > greetings, Dirk.
> >
> >
> > Many ways - here's a simple one:
> >
> >
> > fname = 'C:\TEMP\dirk_2005_10_21.html'
> >
> > File.open(fname, 'w') do |fo|
> > fo.puts('<HTML>')
> > fo.puts('</HTML>')
> > end
> >
> > puts File.read(fname)
> >
> > #-> <HTML>
> > #-> </HTML>
> >
> >
> > daz
> >
>
> I'm using debian, but as I understand it you should use forward
> slashes under windows too. So
>
> fname = 'c:/temp/dirk.html'
>
> would be better. That also saves you from bugs like this one
>
> fname = "c:\temp\dirk.html"
>
> which are not so obvious to spot.
>
> Regards,
>
> Brian
>
> >
> >
> >
> >
>
>
> --
> http://ruby.brian-schroeder.de/
>
> Stringed instrument chords: http://chordlist.brian-schroeder.de/
>
>

------art_26585_12141239.1129982580752--