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

ValueError: need more than 0 values to unpack (Python 2)

I am trying to replicate another researcher's findings by using the Python file that he added as a supplement to his paper. It is the first time I am diving into Python, so the error might be extremely simple to fix, yet after two days I haven't…
Marc-Marijn
  • 151
  • 9
0
votes
1 answer

How can I implement cd command in my own shell in C without using the chdir() function?

I have been searching for a code for implementing the cd command using C in my own shell. However, every code uses the chdir() inbuilt function of C to change the directory. I wanted to know how I can implement cd without using chdir(). Or atleast…
0
votes
0 answers

Rails download: conflicting chdir during another chdir block

I'm installing Ruby on Rails on Windows10, with help from a youtube tutorial How to Install Ruby on Rails on Windows10, author TubeMint Ruby version is 2.6.5 Rails version 6.0.2.1 I've got an error for sqlite3. So I'm making copy/paste from git…
Katy
  • 5
  • 1
  • 2
0
votes
0 answers

Error during change current work directory

When run the code bellow the line os.chdir(folder_path) return a error. What's wrong? That's my folder hierarchy: -data -NotaCorretagem_60076_20181009.pdf -output -report -script -data_extraction.py My data_extraction.py file code: # import…
0
votes
2 answers

How do I change the current working directory of a Python program to the user's home directory?

I'm in python 3.7.3 on MacOS 10.14.5. I found the os.chdir() to change the programs working directory. Now I need to learn how to access the current user's environment variables such as $HOME. One contributor said that user.info contains the home…
0
votes
1 answer

Implementing pushd in python

I am trying to understand how the following is an implementation of the Unix command pushd. Specifically what is the purpose of the yield command given that it yields nothing. @contextmanager def pushd(path): prev = os.getcwd() …
leafystar
  • 129
  • 1
  • 1
  • 7
0
votes
1 answer

How to change directory for scandir on link

I want to small script to print the content of the current directory with scandir. The idea was to made a small tool for filenavigation with preview for the directory the php file is stored in and the possiblity to navigate through the…
user11685721
0
votes
0 answers

PHP chdir issues

My Directories: Main: "WWW" (Here are my php scripts and subfolders) "www/images" (This is where the images sent by users are stored) My scripts are: - Switch.php
Lima
  • 19
  • 6
0
votes
1 answer

In Vim, how can I prevent chdir to buffer directory from running when I switch to terminal pane?

In my .vimrc, I have: autocmd BufEnter * :lchdir %:p:h which changes the current directory to the directory for the file being edited in that window. With the terminal feature enabled, however, I get the following messages: Error detected while…
Sinan Ünür
  • 116,958
  • 15
  • 196
  • 339
0
votes
2 answers

Cannot change directory from inside a function in node.js

I have the following code: module.exports = function(db, threads) { var self = this; this.tick = function() { //process.chdir("AA/BB"); // This line gives error "Error: ENOENT: no such file or directory, uv_chdir" } …
Monday to Friday
  • 239
  • 5
  • 16
0
votes
1 answer

Automate selection of files with Python

I'm coding an interface with Tkinter and I want to automate a task. The actual function opens a window that allows the user to select files (I specify the type of files. Then the paths of these files are retrieved from other functions to modify the…
Tom92
  • 5
  • 1
  • 3
0
votes
1 answer

Saving file as same name but attaching date - referencing cell date

I'm able to run this code without any error, however is giving a slightly different objective. It'll be added below the Do Events section according to the code in the link below. Loop through all excel file in given folder Objective of code: Browse…
Tyler
  • 604
  • 3
  • 10
  • 24
0
votes
1 answer

How to change directory when performing a loop in VBA?

I would like to go up one level to process the following loop. I thought I could use ChDir but I see that when I call the files in, I would be in the incorrect directory. Any help would be appreciated. I would like to generalize the path because the…
t.breeze
  • 67
  • 8
0
votes
2 answers

chdir modifying the path in Python

I've got a program that reads strings with special characters (used in spanish) from a file. I then use chdir to change to a directory which its name is the string. For example in a file called "names.txt" I got the following Tableta …
Jonas M
  • 35
  • 1
  • 7
0
votes
1 answer

How can I change the shell directory in the C language program?

When I use chdir() to change the current directory, the program will not change when the program is shut down. So How can I apply chdir() to Shell after using chdir() and programs have been terminated?
J Y
  • 23
  • 6