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
1
vote
3 answers

Why is this C program doing nothing in Ubuntu?

My very simple C program just hangs and I don’t know why. I am trying to make a simple executable to handle multiple monotonous actions for me every time I start a new programming session. So I decided with something simple (below) yet every time I…
Bartender1382
  • 195
  • 1
  • 10
1
vote
2 answers

Change directory in Java like Perl chdir

In my company we are updating web software that uses a Perl script to perform specific operations. In updating the script, it will be rewritten in Java. The main operations of the script are to move between folders and copy / remove files within…
64Bit1990
  • 302
  • 2
  • 16
1
vote
1 answer

chdir() doesn't change directory: No such file or directory

I want to create a simple c++ programm, that changes directory. int main(int argc, char * argv[]){ //... char input[256]; char *command; //read command fgets(input, 256, stdin); // CODE ADDED WITH HELP command = strchr(input, '\n'); …
NimeQu
  • 13
  • 3
1
vote
0 answers

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 972: invali d start byte

I want to run commands using subprocess but it throws error when I change directory error as UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 972: invali d start byte import os import subprocess while True: command…
1
vote
1 answer

os.chdir() gives NoneType object

I am changing my working directory to make sure images are loaded from the right place. import os cwd = os.getwd() ##works fine newwd = os.chdir("C:\\Users\\Me\\Python\\Images") ##gives NoneType object I never had problems with that…
ISquared
  • 364
  • 4
  • 22
1
vote
1 answer

Best python wrapper for "cd -"

I want to change dirs back in forth in python script. From Bash I would do cd "bla/bla" and then cd - or pushd "bla/bla" > /dev/null and then popd. Python has no wrappers for pushd, popd, or - (which is a Shell variable). Is there a better way…
CIsForCookies
  • 12,097
  • 11
  • 59
  • 124
1
vote
1 answer

chdir in .screenrc on mac

I could chdir in .screenrc in linux so that when I open up screen, I could go to specified directory(for each tab) Haven't had success with chdir in mac with screenrc. Anyone have done this?
eugene
  • 39,839
  • 68
  • 255
  • 489
1
vote
0 answers

os.chdir() command gives FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\ in jupyter notebook

I am using Jupyter notebook and trying to change the current working directory to my system directory i.e. 'C:/Users' but it is giving me an error: FileNotFoundError: [Errno 2] No such file or directory: 'C://Users'. However , the same is working…
1
vote
1 answer

os.chdir() caused unexpected behaviour with python multithreading

I'm new to multi-threading in Python. In my code, I called a function which changes its working directory with chdir() as follows. import threading import os import shutil def sayHello(dirName,userName): if not os.path.exists(dirName): …
Pradeep Sanjeewa
  • 1,911
  • 1
  • 14
  • 25
1
vote
1 answer

why is the function CHDIR not working on the network ? Qbasic BasicA

I have a .bas file that I run using GWBASIC.EXE The .bas file uses other files located in the path : \srv120 (T:)\Basic (GWBASIC.EXE and the .bas file are also in the same directory T\Basic) In the directory T\Basic, I've created another folder…
manny-
  • 129
  • 2
  • 10
1
vote
1 answer

Changing working directory for RunPython import

I am trying to run my Python script from an Excel VBA macro. Originally I did not have an issue because the .py file was in the same directory as the excel file. Now we would like to store the .py file in a different directory and the macro produces…
MMac11
  • 59
  • 1
  • 1
  • 4
1
vote
1 answer

Change current working directory in child process in C

I have to write a program which generates child process than ends parent process and after that that created child process has to ask user to input new working directory, change it and print path to its new working directory. I wrote this, but scanf…
Sz3jdii
  • 507
  • 8
  • 23
1
vote
0 answers

Setting Directories and the If Len(Dir(... statement in VBA

I have a file exists under this path: //path/folder1/folder2/datafile.gdp It is an input to an external program being called from vba in this manner: Sub RunProgram() Dim wsh As Object SetCurrentDirectory "\\path\" ChDir "\\path\folder1\folder2\"…
Petrichor
  • 975
  • 1
  • 9
  • 22
1
vote
1 answer

PHP : chdir('../') not working from command line

I'm developing a PHP cron script to check if a server is up or not (Ping). Here is my code : // Remonte d'un dossier chdir('../'); // Inclusion du header pour avoir les infos de connexion à la db, fonctions, etc…
SatanicGeek
  • 342
  • 5
  • 15
1
vote
0 answers

nginx + php-fpm chdir not working

I'm meeting a problem with getting my nginx and php-fpm working. I'm getting an error 504 when I try to access my application. I have a structure like this; data/mybesite/ | |---revisions/ | |---shared/ | |---released/ |---web/ …
Martinouh
  • 21
  • 4