Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any way to change directory using C language?

Is there any way by which I can change to any directory by executing a C program?

like image 891
Biswajyoti Das Avatar asked Aug 18 '09 12:08

Biswajyoti Das


People also ask

Which method is used for changing directory?

The cd command, also known as chdir (change directory), is a command-line shell command used to change the current working directory in various operating systems. It can be used in shell scripts and batch files.

Can we change directory?

Use the cd command to move from your present directory to another directory. You must have execute (search) permission in the specified directory.

How do I change the working directory in a script?

Often, you may want to change the current working directory, so that you can access different subdirectories and files. To change directories, use the command cd followed by the name of the directory (e.g. cd downloads ). Then, you can print your current working directory again to check the new path.

What is C in directory?

In Windows operating systems, the C drive as represented as “C:\”, the backlash representing the root directory of the drive. The C drive is considered as the primary hard drive of the system and is used for storing the operating system, system files and other applications and their related files.


1 Answers

The chdir() function. For more info, use man chdir.

like image 56
Michael Foukarakis Avatar answered Oct 04 '22 16:10

Michael Foukarakis