Sep-09-2018, 03:37 AM
in a script/app that expects to access many (read or write) files in the home directory, what is the simplest code to switch the current directory to be the user's (who runs it) home directory. "simple" does not necessarily mean making it be a one liner. if the user is trying to debug the code and thinks maybe the change to the home directory is not working right, "simpler" makes easier for someone to debug it. and how well does it handle error cases, such as wrong permissions that do not allow switch to the home directory?