Dear Statalisters,
I manage my work in multiple computers with different paths for the same project. All my *.do files therefore start with a set of codes that identifies the machine by the 'hostname' and set the file location path accordingly, such as:
The solution above was working fine for me for many years. All of a sudden since this morning my Stata is not recognizing the commands for my path locations. I then looked that the hostname:
You can see above that the ".local" extension disappeared from the 'hostname' which was there for many years (see the red colored hostnames in the first set of codes which were there for many years). This is consistent to the result I obtain using terminal if you type -hostname- in the terminal. However, it gets confusing when I go to my mac system preference->sharing, it says that "Computers on your local network can access your computer at "Roms-iMac.local" (the extension is there!). So far I understand from OSX documentions that OSX adds *.local extension automatically by default to whatever the hostname is supplied and that was being used in all my dofiles so far i.e., the system was being recognized as "Roms-iMac.local".
Now while I am baffled and not sure what is causing the system not recognizing the extension of the hostname anymore even though it is there, one solution to my problem is to change the hostname in all my *.do files from "Roms-iMac.local" to "Roms-iMac"but that will require me to change all my *.do files and I will hate that.
I wonder is there any other way to make Stata recognizing the hostname as "Roms-iMac.local" instead "Roms-iMac"? That will save me from changing all my *.do files.
Thanks.
System: iMac (late 2015)
OSX: macOS Montrey (all updated as of today)
Stata.version.17 (all updated as of today)
I manage my work in multiple computers with different paths for the same project. All my *.do files therefore start with a set of codes that identifies the machine by the 'hostname' and set the file location path accordingly, such as:
Code:
****Start of a particular do file for one particular analytical project:**********
******************************************************************************************
if "`c(hostname)'" == "Roms-MacBook-Pro.local" {
cd "/Users/Rom"
}
if "`c(hostname)'" == "Roms-iMac.local" {
cd "/Users/rom/Desktop/bla...."
}
if "`c(hostname)'" == "TZKC96058HTY" {
cd "C:/Users/bpd/"
}
if "`c(hostname)'" == "biosciences" {
cd "/Users/rom87/"
}
pwd
Code:
di "`c(hostname)'" Roms-iMac
Now while I am baffled and not sure what is causing the system not recognizing the extension of the hostname anymore even though it is there, one solution to my problem is to change the hostname in all my *.do files from "Roms-iMac.local" to "Roms-iMac"but that will require me to change all my *.do files and I will hate that.
I wonder is there any other way to make Stata recognizing the hostname as "Roms-iMac.local" instead "Roms-iMac"? That will save me from changing all my *.do files.
Thanks.
System: iMac (late 2015)
OSX: macOS Montrey (all updated as of today)
Stata.version.17 (all updated as of today)
Comment