relative-path

How can we use the current directory path(%~dp0) with 'ren' command in a batch file?

末鹿安然 提交于 2019-12-11 11:45:58
问题 I want to rename a file which is present in the sub directory and the known part of the file name is ' .log '. When I try something like below ren subdirectory\*.log* file2.txt or ren .\subdirectory\*.log* file2.txt I get error : The syntax of the command is incorrect. I have two questions here: Do I always need to give full path in ren command for file1? If yes, then how can I we give the full path if I do not want to hard code it? I got to know that we can use ' %~dp0 ' to get the current

require_once in php

試著忘記壹切 提交于 2019-12-11 07:00:37
问题 I have a php file which has a require_once Statement (?) this file is then in included in 2 other php files, one php file is in a sub directory so the layout is like this ("file1" and "file2" include the file "included" which require_onces the "required")# L--subfolder1 | L--file1 L--subfolder2 | L--required L--file2 L--included How can I reference the "required" file from the "included" file so that it will work from both file1 and file2? 回答1: always use absolute path $_SERVER['DOCUMENT_ROOT

Should I use relative path for pages within the site? or it doesn't matter?

左心房为你撑大大i 提交于 2019-12-11 06:34:44
问题 I was just wondering what is the best way to define urls linking to pages within a domain name. For example, for domain www.example.com .. I can have links like <a href="http://www.domain.com/test.html">test</a> or <a href="test.html">test</a> One of the issues, which I came across was that while using templates .. if I use html template with relative links then I can't use the same template for directory www.example.com/directory2 as the common links won't work for that page .. neither the

Get license file from a folder in C# project

余生长醉 提交于 2019-12-11 06:06:58
问题 I have a license file that I need to access at runtime in order to create pdf-files. After I have created the in memory pdf, I need to call a method on that pdf to set the license, like this: pdf.SetLicense("pathToLicenseFileHere"); The license file is located in the same project as the.cs-file that creates the pdf, but is in a separate folder. I cannot get this simple thing to behave correctly, which makes me a bit sad, since it really shouldn't be that hard. :( I try to set the path like

Using Root-Relative Links With Subdomain

匆匆过客 提交于 2019-12-11 05:55:43
问题 I have inherited a website where the previous developer has coded all links relative to the site root, with a leading backslash in each link: <link href="/css/file.css" /> <script src="/js/file.js"></script> This works great for when the site is hosted on a server, as the links will equate to: http://www.example.com/css/file.css http://www.example.com/js/file.js However, I'm trying to get these links to work correctly when called from within a subfolder for local testing. Specifically, I'm

Relocating “.fig” files when creating a GUI using Matlab GUIDE

徘徊边缘 提交于 2019-12-11 05:09:19
问题 I've developed a GUI for some build scripts, and am now in the process of deploying it. As the script will be deployed to a number of different machines at various points, I need to use the standard format of directories that the team use. The GUI consists of a ".fig" file that contains the visual definition of the UI, and a m-script that defines the functionality. I need to locate these two in "fig/" and "m/" folders respectively, but I can't figure out how to. I first searched for an

iPhone pathForResource vs bundlePath

夙愿已清 提交于 2019-12-11 04:29:36
问题 I want to use pathForResource, but it doesn't look like it will create the path if one doesn't exist. Therefore I'm trying to create one manually by doing the following: NSString *path = [NSString stringWithFormat:@"%@/%@.plist",[[NSBundle mainBundle] bundlePath],@"myFileName"]; I'm creating files dynamically, so I need to access them after I have Build and Run the application. But it puts the project in a unique id folder so the path comes out to something like: /Users/RyanJM/Library

Resolving absolute path from relative path

僤鯓⒐⒋嵵緔 提交于 2019-12-11 03:07:29
问题 I'm making a web-crawler and I'm trying to figure out a way to find out absolute path from relative path. I took 2 test sites. One in ROR and 1 made using Pyro CMS. In the latter one, I found href tags with link "index.php". So, If I'm currently crawling at http://example.com/xyz , then my crawler will append and make it http://example.com/xyz/index.php . But the problem is that, I should be appending to root instead i.e. it should have been http://example.com/index.php . So if I crawl http:/

environment variable of visual studio path?

别说谁变了你拦得住时间么 提交于 2019-12-11 00:39:41
问题 Thanks for reading this thread. Basically I am wondering how I can use relative path/environment variable pointing to visual studio 2012 vcvarsall.bat file in a script? I am currently using absolute path: call "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.bat" x86_amd64 How can I do something like this? call "$(System)\$(Program Files)$(VS)\$(VC)\vcvarsall.bat" x86_amd64 Thanks a lot. EDIT What if I have more than one version of visual studio? I have vs2008 and vs2012 both

How does file creation work in Java

丶灬走出姿态 提交于 2019-12-10 18:52:18
问题 I am trying to create a file using File newFile = new File("myFile"); However no file called "myFile" is created. This is within a Web application Project i.e. proper form to be pakaged as a WAR but I am calling it as part of a main method (just to see how this works). How can I make it so that a new file is created at a location relative to the current one i.e not have to put in an absolute path. EDIT: newFile.createFile(); Doesn't seem to work: Here is the entire code: import java.io.File;