working-directory

Running File from Notepad Plus Plus and Current Directory

允我心安 提交于 2019-12-11 04:35:13
问题 There are a number of examples on the web of how to run a file from the Notepad Plus Plus (NPP). But they all fail to account for the fact that the current working directory is the location of the NPP's executable, and not the location of the file. Usually they go something like this: cmd /K "$(FULL_CURRENT_PATH)" Consider the following Python script: with open('somefile.txt', 'a') as file: file.write('Hello there.\n') This file will be created in the NPP folder, which is not at all what most

Julia language - State in @async tasks :: Current-Directory

狂风中的少年 提交于 2019-12-11 02:06:54
问题 I've noticed (read: caught a production bug) different Tasks in Julia - do not have their own working directory, but that the current directory - is shared. I realise in an OS level this is kind of obvious (a process has a working-directory). My question is first - is there any other obvious or less obvious global state I should watch out for (obviously environment variables, or any global variables). Second - should this be more documented, or avoided by the task abstraction, - a "Task" in

VBScript current directory + sub directory?

梦想与她 提交于 2019-12-10 23:34:32
问题 I am trying to get the path of a file that is within a sub-directory of the current directory in VBScript. The following does not seem to work? currentDirectory = left(WScript.ScriptFullName,(Len(WScript.ScriptFullName))-(len(WScript.ScriptName))) FileToCopy = currentDirectory & "\test\user.js" Here is the entire code: Set oFSO = CreateObject("Scripting.FileSystemObject") strFolder = oFSO.GetParentFolderName(WScript.ScriptFullName) FileToCopy = oFSO.BuildPath(strFolder, "unproxy\user.js") ''#

Removing the current working directory from the path

只愿长相守 提交于 2019-12-10 21:19:10
问题 I'm working in Windows and would like to know if there is a way to remove the current working directory from the path? I understand that this is the default behavior in PowerShell, but I need it to work in batch or at the Windows command-line. In UNIX, I would just make sure that my $PATH variable not contain . . Is there any way to accomplish this in batch? This is the current behavior: H:\tmp>dir Volume in drive H has no label. Volume Serial Number is E29C-7B61 Directory of H:\tmp 04/27

How to import working directory for JUnit from maven to IDEA

ぃ、小莉子 提交于 2019-12-10 14:07:29
问题 I am trying to make new developers of my maven project to have as easy start as possible. I am using and recommending IntelliJ IDEA as an IDE for them. I am pretty satisfied with the results of importing the maven project to IDEA. The only complication that I have now is importing of the working directory from the surefire plugin. In my pom.xml I have the following: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.7.2</version>

current working directory in a vbscript invoked by a drag & drop operation

北城以北 提交于 2019-12-10 11:23:09
问题 When I was trying to get elevated rights for my batch script, when I found two related SO questions How to request Administrator access inside a batch file How can I auto-elevate my batch file, so that it requests from UAC administrator rights if required? ...that led to answers that worked partially. For some reason, I had issues with command line passing for file path arguments containing spaces within the VBS script, so I tried to break the solution into 3 parts and concentrated on the

C# Get working directory of another process

安稳与你 提交于 2019-12-10 03:34:36
问题 I want to determine the absolute path of files used by a known process by reading the command line. Currently, the process is started with relative paths in the command line that point to various files such as config files. The problem is that if the paths are not relative to the folder containing the executable, I have no way of converting the relative paths provided at the command line, well I can't be 100% sure. For example two batch files: BATCH 1 CD c:\test\bin test.exe ..\config\config

How do Perl Cwd::cwd and Cwd::getcwd functions differ?

喜欢而已 提交于 2019-12-10 02:15:48
问题 The question What is the difference between Cwd::cwd and Cwd::getcwd in Perl, generally, without regard to any specific platform? Why does Perl have both? What is the intended use, which one should I use in which scenarios? (Example use cases will be appreciated.) Does it matter? (Assuming I don’t mix them.) Does choice of either one affect portability in any way? Which one is more commonly used in modules? Even if I interpret the manual is saying that except for corner cases cwd is `pwd` and

Specify directory with setwd()

本小妞迷上赌 提交于 2019-12-09 13:42:16
问题 I understand that in R to set my working directory I can do: setwd("~/dir1/dir2/mydir") If mydir is a unique directory name, is there way to specify the working directory without stating dir1/dir2 ? Thanks 回答1: Sys.glob does what you want: setwd(Sys.glob("~/*/*/mydir")) If you don't know how deep it's nested, you can use list.files or dir : list.files(path="~", pattern="mydir", all.files=TRUE, full.names=TRUE, recursive=TRUE, ignore.case=FALSE, include.dirs=TRUE) 来源: https://stackoverflow.com

Batch file to change directory run from within powershell does nothing

岁酱吖の 提交于 2019-12-08 05:13:06
问题 I have a small "dev.bat" batch file on my PATH which I run to switch to my development project directory in W:\ . This works fine from CMD but not when run from PowerShell (or PWSH). I have no other problems running .bat files from PowerShell. PS C:\> type C:\dev.bat W: CD W:\dev PS C:\> dev.bat me@computer C:\ > W: me@computer W:\dev > CD W:\dev PS C:\> echo "Why did dev.bat not change directory??" Why did dev.bat not change directory?? PS C:\> W: PS W:\> No, cmd /c dev.bat makes no