Siva Kannan
Siva Kannan

Reputation: 2481

how to check a directory in a particular path not in CWD?

i know to check in the current directory opendir(dir_name) , but i need to check that in some other path , not in the CWD(current working directory),

or is there any function is to move the CWD to some other directory while executing

Upvotes: 0

Views: 48

Answers (2)

Lee Duhem
Lee Duhem

Reputation: 15121

You could use opendir(abs_path/dir_name) to open a directory dir_name under absolute path abs_path.

You also could use chdir() to change your cwd to other directory.

Upvotes: 2

Ankit Tripathi
Ankit Tripathi

Reputation: 384

Yes the daemon process change their directory to root while executing. The function to change the working directory while executing is chdir(PATH_TO_SET_AS_CWD).

Upvotes: 1

Related Questions