Friday, February 22, 2013

No such file or directory?

Sometimes when a shell session shows you this error it baffles. You check the file exists, you check the syntax for the command, you check the permissions. You do everything that a page like this suggests you do.

And then you realise that the entire directory you are attempting to execute a command within has been deleted or recreated since your shell set it as its current working directory.

I stumble across this problem from time to time when I have multiple shell windows open. If you are in a particular directory in session 1, and delete that directory in another, even if you immediately recreate a directory with the same name, all further commands in the first session that are dependent on relative directories are doomed to failure.

This makes sense, but sometimes it takes me a while to remember. Maybe writing this post will trigger my memory earlier in the piece in the future.

1 comment:

  1. Looking for a Local Irish Business? Here at Local Directory we list hundreds of Irish businesses and services that work nationwide and Locally in Ireland.