RE: change drive on Windows

From: Fine, Valeri <fine_at_bnl.gov>
Date: Wed, 28 Feb 2007 09:24:07 -0500


> in TSystemDirectory::workdir.

On windows there is no single "working directory". Each drive has its own working directory.

ROOT does not provide the generic method to do that.

  You need
  const char * TWinNTSystem::WorkingDirectory(char driveletter)

#ifdef R_WIN32
# include "TWinNTSystem.h"
#endif

 . . .

#ifdef R_WIN32
const char *myworksingdir =
((TWinNTSystem*)gSystem)->WorkingDirectory('d'): #else
const char *myworksingdir = gSystem->WorkingDirectory(): #endif

Best Regards

                         Valeri Fine


Brookhaven National Laboratory
Upton, NY 11973, USA
Phone: +1 631 344 7806
Fax: +1 631 344 4206
E-mail: fine_at_bnl.gov

> -----Original Message-----
> From: owner-roottalk_at_pcroot.cern.ch

[mailto:owner-roottalk_at_pcroot.cern.ch]
> On Behalf Of Kazuyoshi Furutaka
> Sent: Wednesday, February 28, 2007 7:17 AM
> To: roottalk_at_pcroot.cern.ch
> Subject: Re: [ROOT] change drive on Windows
>
> Dear rooters,
>
> From: Philippe Canal <pcanal_at_fnal.gov>
> Subject: RE: [ROOT] change drive on Windows
> Date: Tue, 27 Feb 2007 11:06:27 -0600
>
> > Simply do: gSystem->cd("d:\\");
> >
> > Cheers,
> > Philippe.
>
> Thanks, Philippe. It works.
>
> Luca Boncagni <boncagni_at_frascati.enea.it> also
> kindly taught the command via private e-mail.
> Thanks Luca.
>
>
> I have one more question.
>
> How do we access files in different drives than the
> drive from which root shell was invoked, using TBrowser?
> By doing gSystem->cd("d:\\"), I can see files on
> the new drive from root/cint shell, but even after
> the command I could only see files on the old drive
> in TSystemDirectory::workdir.
>
> Thanks in advance.
>
> Yours,
> Kazuyoshi
> --
> Kazuyoshi Furutaka
> furutaka_at_jb3.so-net.ne.jp
Received on Wed Feb 28 2007 - 15:25:09 CET

This archive was generated by hypermail 2.2.0 : Wed Feb 28 2007 - 17:50:00 CET