Questions tagged [chdir]

chdir (or cd) is a command to change the working directory (change directory). It is part of many operating systems and programming languages. On many OS `chdir()` also is a system call.

cd, sometimes also available as chdir (change directory), is a command line command to change the current working directory in operating systems such as Unix, DOS, OS/2, AmigaOS (where if a bare path is given, cd is implied), Windows, and Linux. It is also available for use in shell scripts and batch files.

More details see cd Wikipedia article

202 questions
0
votes
1 answer

chdir not working on Spartan 6 SP605 FPGA

I am working on a project that uses the Spartan 6 FPGA eval kit. The problem I am having is that when trying to change the directory on the CF card, the software can't build the working stack. The directory is "a:\\setup" and that is being passed to…
RXC
  • 1,233
  • 5
  • 36
  • 67
0
votes
2 answers

argv does not work with chdir

I am trying to change the current working directory to the path of the executable, using chdir() in the following manner: #include #include using namespace std; int main(int argc,char *argv[]) { if(chdir(argv[0]) == 0)…
Yoav Kadosh
  • 4,807
  • 4
  • 39
  • 56
0
votes
2 answers

How to chdir using C in Linux environment

I am new in c programming. How can I change directory like /home/jobs/$ans/xxx/ while I have $ans is a user string I can't chdir in c program. My script is below: #include #include int main() { char jdir; printf("Enter…
user1795444
  • 1
  • 1
  • 1
  • 1
0
votes
1 answer

Getting Ruby to chdir to remote server on Windows

I am stuck with changing a directory to "\10.10.10.10\D$\some_dir" FileUtils.chdir("\\\\10.10.10.10\\D$\\some_dir\\") and Dir.chdir("\\\\10.10.10.10\\D$\\some_dir\\") do not work in Ruby 1.9.3! It worked in Ruby 1.8.7 Any ideas how to change dir…
qwebek
  • 949
  • 2
  • 8
  • 15
0
votes
1 answer

PHP & Cron - chdir not working

I have a PHP script which is run as a daemon. 8 threads run at once. To ensure 8 threads are always running, the following PHP script is run from cron, which is in the same directory as the daemon.php script:
Alasdair
  • 13,348
  • 18
  • 82
  • 138
-1
votes
1 answer

chdir(getenv("HOME") returns Bad address

char *home = getenv("HOME"); if (!strcmp(t->argv[0], "cd")) { if (!t->argv[1]) { chdir(home); } if (chdir(t->argv[1])) { perror(t->argv[1]); } } what this is supposed to…
-1
votes
1 answer

os.chdir doesn't change directories

When I ask to watch a TV show it lists my TV shows available to me, but when I ask to go into the chosen TV show to show the season it doesn't seem to chdir. I get it printing what it understood, which is right. It just doesn't actually change to…
2schweet
  • 1
  • 2
-1
votes
2 answers

How do I change my working directory in a proper manner?

I'm working in Google Colab and I'm trying to change to working directory to my desktop (desktop = bureaublad in dutch thats why you see 'bureaublad in my path). However, changing the working directory keeps giving me the error that such a directory…
-1
votes
1 answer

Cannot change directory using os.Chdir()

os.Chdir() in golang is not working properly. package main import ( "fmt" "os" ) func main() { command := "cd C:\\" if err := os.Chdir(command[3:]); err != nil { fmt.Println("Error:\tCould not move into the directory…
asd plougry
  • 143
  • 1
  • 9
-1
votes
1 answer

Python os.chdir changes "\" to "\\" when passing path/directory path, any ideas to fix?

I am trying to change directory using a variable which contains a path but os.chdir changes the \ in the path to \ which makes it undreadable/undefined for the os module and crashes. any ideas on how to overcome this please?[shot ][1]
-1
votes
1 answer

basic shell - ls command after chdir()

I'm trying to create a basic shell, but I have a problem. The shell changes directory just fine, and outputs an error if the user inputs an invalid directory. The shell also has an internal command for "pwd" and prints out the new working directory…
-1
votes
1 answer

Strange bug with chdir in c

building a small shell like prog i try to make cd command, so i use: if (!strcmp(cmd, "cd") ) { if(chdir("args[1]")!=0){ printf(" %s - path not found\n",args[1]); perror("Error:"); } } the output is…
JohnnyF
  • 1,053
  • 4
  • 16
  • 31
-1
votes
2 answers

PHP - Going back directories

I've encountered something when trying to include/require a php script that's 2 directories back. It's not really a problem as I figured out a work around, however I'd love an explanation for what's happening. Here's the file…
mickzer
  • 5,958
  • 5
  • 34
  • 57
-1
votes
1 answer

Change language directory without redirecting to the index page

I have a site in three languages: www.mysite.com/it/FILES www.mysite.com/de/FILES www.mysite.com/fr/FILES On the header of the site I have three link, one for each language. Each link redirect to /language/index.php I'd like to redirect the…
user2120569
  • 227
  • 1
  • 3
  • 9
-2
votes
1 answer

Changing directory every running python script

How can I change directory every launch programm? For example, I need to ask directory before programm running: a = input() 06 os.chdir("C:\\Test\\a.2020") > os.chdir("C:\\Test\\06.2020")
1 2 3
13
14