chdir and dev function example