working-directory

How does WPF OpenFileDialog track directory of last opened file?

ぐ巨炮叔叔 提交于 2019-12-20 03:08:26
问题 As we know WPF OpenFileDialog no more changes the app's working directory and RestoreDirectory property is "unimplemented". However, upon subsequent open, its initial directory is default to the last opened file rather than the original working directory, so this information must be stored somewhere. I wonder is it possible to get/set it from user code? 回答1: On Windows 7 the recent file information is stored in the registry at this key: HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer

Precisely what owns the 'current working directory'?

最后都变了- 提交于 2019-12-19 19:47:12
问题 I'm aware what a working directory (wd) is and it's purpose (for writing software at least). What I don't understand is the ownership of the wd. Furthermore, I want to understand how the answer may vary between operating systems so any clarification on unusual behaviour on a particular OS would be appreciated. So firstly, where does the wd manifest itself? Is it within a process, and all threads created by that process share the same wd? If the wd gets modified by thread 'A', is the change

Why does checkout sometimes stage a file?

爱⌒轻易说出口 提交于 2019-12-19 09:53:47
问题 When I first started using Git, I found the checkout command quite confusing. However, as I adapted to Git's model of version control, it started to make sense. Now I am having to teach Git to my coworkers, and I'm trying to explain checkout simply. I thought I had a simple explanation (from the documentation): Checkout a branch or paths to the working tree That seems to unify some of the things you can do with checkout which seem like a diverse set of operations to someone new to Git: git

How to set the working directory of a command in a Windows batch file?

本秂侑毒 提交于 2019-12-18 12:05:05
问题 Let's say I have these commands: Prog1.exe D:\SomeDir\Prog2.exe Prog3.exe Now, say for the second line, I would like the working directory to be D:\SomeDir, but in Prog1.exe and Prog3.exe I want the default working directory (normally, where my .bat file is). If I try this Prog1.exe cd D:\SomeDir D:\SomeDir\Prog2.exe Prog3.exe Apparently Prog3 will be executed in SomeDir, which is not what I want. 回答1: You could use the pushd/popd commands (help with pushd /? ) Prog1.exe Pushd D:\SomeDir

Getting a working copy of a bare repository

泄露秘密 提交于 2019-12-17 18:15:17
问题 I have a server on which I have a bare repository for pushing. However, my server needs to have a working copy of the master branch. How do I get a working copy and that only from a bare repository? 回答1: You can simply clone the repository to another directory on the same machine: git clone /bare/repo/dir.git The current directory will become a non-bare clone of your repo, and you'll get a checkout of the master branch automatically. Then use the usual commands like git pull to update it as

How do I set the working directory of the parent process?

荒凉一梦 提交于 2019-12-17 02:37:43
问题 As the title reveals it, we are writing a Unix-style shell utility U that is supposed to be invoked (in most cases) from bash. How exactly could U change the working directory of bash (or parent in general)? P.S. The shell utility chdir succeeds in doing exactly the same, thus there must be a programmatic way of achieving the effect. 回答1: Don't do this. FILE *p; char cmd[32]; p = fopen("/tmp/gdb_cmds", "w"); fprintf(p, "call chdir(\"..\")\ndetach\nquit\n"); fclose(p); sprintf(cmd, "gdb -p %d

Error using Process.Start()

99封情书 提交于 2019-12-14 03:18:36
问题 I am trying to run sysprep from a vb.net application, and even though the path and file name are confirmed accurate, it is returning that it can not find the file. I've tried using process.start, declaring as a new process, declaring the path separate from the file name. Here is the code as I would like it to be written, maybe someone could try it out and see if they come up with a solution? Private Sub btnsysp_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsysp

Why does my working directory change to C:\Windows\System32 when I use a Console subsystem

半世苍凉 提交于 2019-12-13 07:59:26
问题 I'm using SDL in VS2013 and I'm trying to load an image from the folder that my working directory should be using a relative path. Which is where the .vcxproj files are. However I discovered that the working directory is not the folder it should be, it is actually in C:\Windows\System32. I have realised that this is only the case when I go to linker, system and then change the subsystem to CONSOLE. In a WINDOWS subsystem it uses the correct working directory. Why is this happening and how do

Getting process information in .NET

泪湿孤枕 提交于 2019-12-11 16:42:11
问题 Duplicate of this question. update - This is not an exact duplicate. See my solution. I see a java.exe process in process explorer, and double clicking it gives me its working directory & starting command line arguments. From .NET, I run the following code and get a process with the same PID but the above fields are empty. Apparently, this is documented. foreach (Process process in Process.GetProcessesByName("java")) { ... } So how do I get the correct startinfo field values, without peeking

system(“c:\\sample\\startAll.bat”) cannot run because of working directory?

╄→尐↘猪︶ㄣ 提交于 2019-12-11 08:31:29
问题 I have an application and executables. I want my application to run my executables. The executable files are in a folder, lets say in "c:\sample". In this directory there is a batch file that calls my exe's. like: start a1.exe start a2.exe start a3.exe let's name it as startAll.bat and suppose every exe has a data like a1.dat a2.dat ... and these data files are near this exe's. I want to call this batch file by my application. system("c:\\\\sample\\\\startAll.bat"); when I call it like that,