working-directory

How to get current relative directory of your Makefile?

被刻印的时光 ゝ 提交于 2019-11-27 16:51:55
I have a several Makefiles in app specific directories like this: /project1/apps/app_typeA/Makefile /project1/apps/app_typeB/Makefile /project1/apps/app_typeC/Makefile Each Makefile includes a .inc file in this path one level up: /project1/apps/app_rules.inc Inside app_rules.inc I'm setting the destination of where I want the binaries to be placed when built. I want all binaries to be in their respective app_type path: /project1/bin/app_typeA/ I tried using $(CURDIR) , like this: OUTPUT_PATH = /project1/bin/$(CURDIR) but instead I got the binaries buried in the entire path name like this:

Show files in current directory using Git Bash?

萝らか妹 提交于 2019-11-27 13:45:24
问题 How can I check files in current directory, from git bash? Like command dir , in Windows cmd ? I found a command git ls-files , but it's work only with git repository files. But if I navegate through drive C:\, and want to see files in current directory, how can I do that in git bash? 回答1: The git bash is basically a Unix shell, therefore you can list current files and directories with the ls command You can also use ls -a to show hidden files and folders. Since it is a Unix shell, you can

NodeJs child_process working directory

空扰寡人 提交于 2019-11-27 13:24:53
问题 I am trying to execute a child process in a different directory then the one of its parent. var exec = require('child_process').exec; exec( 'pwd', { cdw: someDirectoryVariable }, function(error, stdout, stderr) { // ... } ); I'm doing the above (though of course running "pwd" is not what I want to do in the end). This will end up writing the pwd of the parent process to stdout, regardless of what value I provided to the cdw option. What am I missing? (I did make sure the path passed as cwd

How to get the current working directory using python 3?

谁说我不能喝 提交于 2019-11-27 13:23:47
问题 When I run the following script in IDLE import os print(os.getcwd()) I get output as D:\testtool but when I run from cmd prompt, I get c:\Python33>python D:\testtool\current_dir.py c:\Python33 How do I get same result which I got using IDLE ? 回答1: It seems that IDLE changes its current working dir to location of the script that is executed, while when running the script using cmd doesn't do that and it leaves CWD as it is. To change current working dir to the one containing your script you

How to set root folder for PHP include files

折月煮酒 提交于 2019-11-27 11:19:34
问题 I've spent days researching the internet and I can't find the answer that I will understand and are able to implement. I've got the website in which I want to use include_once files and be able to view the website properly in both localhost and the actual server. I've used $_SERVER['DOCUMENT_ROOT'] before but it doesn't work on the localhost so it is hard for me to update and do the changes to the website. What I want to do is to create some sort of config.php file in which I can tell it that

How do I find the current directory?

浪子不回头ぞ 提交于 2019-11-27 09:04:23
I am trying to read a file which I read previously successfully. I am reading it through a library, and I am sending it as-is to the library (i.e. "myfile.txt"). I know that the file is read from the working/current directory. I suspect that the current/working directory has changed somehow. How do i check what is the current/working directory? Since you added the visual-c++ tag I'm going to suggest the standard windows function to do it. GetCurrentDirectory Usage: TCHAR pwd[MAX_PATH]; GetCurrentDirectory(MAX_PATH,pwd); MessageBox(NULL,pwd,pwd,0); Boost filesystem library provides a clean

Find Install directory and working directory of VSTO Outlook Addin; or any Office Addin

杀马特。学长 韩版系。学妹 提交于 2019-11-27 04:35:47
问题 I created a VSTO Outlook Addin that uses a library Html2Xhtml.dll (.NET) which calls another Html2xhtml.exe by executing System.Diagnostic.Process.Start(). However, it fails to call Html2xhtml.exe (i think) because the working directory even when launched from Visual Studio is the current user My Documents folder. I have no control over the code in Html2Xhtml.dll so I cannot use absolute path; but I suppose I can change the working directory of the Add-in at runtime. However, If I install

Change the current working directory in C++

南笙酒味 提交于 2019-11-27 01:24:35
How can I change my current working directory in C++ in a platform-agnostic way? I found the direct.h header file, which is Windows compatible, and the unistd.h , which is UNIX/POSIX compatible. The chdir function works on both POSIX ( manpage ) and Windows (called _chdir there but an alias chdir exists). Both implementations return zero on success and -1 on error. As you can see in the manpage, more distinguished errno values are possible in the POSIX variant, but that shouldn't really make a difference for most use cases. For C++, boost::filesystem::current_path (setter and getter prototypes

Golang: tests and working directory

夙愿已清 提交于 2019-11-26 22:41:24
问题 I'm writing some unit tests for my application in Go. The tests fail however because it cannot find the configuration files. Normally the binary looks for the configuration files in the working directory under the path conf/*.conf . I figured that browsing to the directory that has conf/ and running go test in it would solve it, but it still reports that the file system cannot find the path specified. How can I tell go test to use a certain directory as the working directory so that the tests

Why does 'Run as administrator' change (sometimes) batch file's current directory?

我怕爱的太早我们不能终老 提交于 2019-11-26 21:47:53
问题 I have a batch file that is in the same directory as the file I want to xcopy . But for some reason the file is not being found. I thought that current directory was always where the batch file was located. I run batch file as administrator. This occurs on a Windows 7 64-bit desktop computer. Batch file: @ECHO OFF XCOPY /y "File1.txt" "File2.txt" PAUSE Error: File not found - File1.txt 0 File(s) copied 回答1: Which directory is current working directory on starting a batch file with context