RE: [ROOT] "Save the selected Canvas/Pad as" --> changes default directory

From: Faine, Valeri (fine@bnl.gov)
Date: Wed May 07 2003 - 22:15:56 MEST


> 
> Hello,
> 
>  I am using win32 root v3.05/3 on win2k.  When I save a canvas using
that
> window's "File->Save As" menu item, the root's (file system) directory
> changes:
> 
>  .!cd displays the directory that the canvas was saved in
> 
> however,
> 
>  gSystem->cd() displays the original directory prior to the Canvas's
"Save
> As"
> 
> I suspect this is not the intended behavior (e.g. "Save As" changes
the
> default directory), but if it is, should'nt gSystem->cd() reflect this
> change?
> 

  Hello Ed, 

To get the current working directory one should use the methods

               TSystem::pwd();

What about cd()  I found no method TSystem::cd() at all.

There is TSystem::cd(const char *path).
What you suggest means the method should return its own input parameter.
That is not very useful.  The method cd returns the replaced directory,
i.e. one we have changed with the "path".

   Valeri


  Home
  It seems to me this is the "Correct" behavior of cd method:

   Bool_t cd(const char *path) { return ChangeDirectory(path); }

  Because TWinNTSystem::ChangeDirectoiry() return the previous directory
  There is no means to return the inout parameters.

Rhe proper method to get the current working directory is
TSystem::HomeDirectory()
> Thanks,
>  Ed Oltman
> 



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:11 MET