Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Saving a file in the root

Status
Not open for further replies.

moof15

Programmer
Aug 22, 2002
23
0
0
US
I have to change this script from saving the file in the root to saving it in another directory.

$ROOT = $^O =~ m/MSWin32/ ? $ENV{SystemDrive} : $ENV{HOME},
$xmlSaveFile = 'Install-save.xml';
$CWD = $FindBin::Bin;

This Install-save.xml has to be saved in :
"c:\temp\install-save.xml"

Is there any way to change this??
 
$ROOT = $^O =~ m/MSWin32/ ? $ENV{SystemDrive} : $ENV{HOME};

This line is checking the OS and making the $ROOT variable be the Drive letter if it's Windoze, and the users Home directory if it's anything else (*nix).

You could change it to this if you always wanted it to be "C:\temp\" on a windoze machine, and still retain the *nix directory name if necessary.

$ROOT = $^O =~ m/MSWin32/ ? 'C:\temp\' : $ENV{HOME};

--jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top