relative-path

PHP: Defining relative paths compatible with HTML Tags

Consider the following directory structure: ROOT ------ images ............... logo.png ------ includes ............... vars.php ------ layout ............... content.php ------ index.php How do I define a path constant for logo.png in vars.php that is accessible in both index.php and content.php? Should be compatible with HTML Tags ...

How to link a relative html file in the scenario where user can call the files from the browser by adding a / at the end.

(Sorry I am not able to frame question correctly.) Following is the scenario. I have 2 Html files. File1.Html has <a href="File2.html">Click Me</a> File2.Html has <a href="File1.html">Click Me</a> Now when I open the file1.html in browser by typing following in browser. http://Localhost/File1.html The file1.html with a link i...

How do I find a file that may not be fully-qualified by using the environment path?

I have an executable name, like "cmd.exe" and need to resolve it's fully-qualified path. I know the exe appears in one of the directories listed in the PATH environment variable. Is there a way to resolve the full path without parsing and testing each directory in the PATH variable? basically I don't want to do this: foreach (string ...

Why do I get an IOException when I try to consume an image file that was added to the project as a link?

I have an IValueConverter in WPF that converts a relative file path to a BitmapImage. The Code: public class RelativeImagePathToImage : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { var relativePath = (string)value; if (string.IsNullOrEmpty(relati...

relative path to a groovy application

Hi I am developing an application -called smtool- using Groovy and Grails. This application must be integrated to a portal. The portal have the restriction that every link must be relative. No absolute paths are allowed neither for links nor for images, js files, css files, etc. My application has a menu with many links pointing to di...

How to force relative pathing with Struts 2.1 and Dojo?

I upgraded from Struts 2.0.6 to 2.1.6 and converted all my Ajax themes to plugins. Everything works except the pathing has changed from relative to absolute. For example, here is the rendered HTML before upgrade: <script type="text/javascript" src="../struts/simple/dojoRequire.js"></script> And here it is after upgrade: <script lan...

IIS virtual directory and ASP.NET directory paths

The problem I'm running into the typical virtual-directory dilemma in that you have some paths on your ASP.Net application and you deploy the app in a IIS virtual directory. Then all paths relatives to the "web root" (f.i., "/images") doesn't work because the app is in a virtual directory path. The solutions A. Make the "images" fol...

getting relative path from flash.net.FileReference;

I'm trying to get the relative or full path from a FileReference object after its browsed but I think I'm bashing my head up against a wall (It's begining to hurt) anybody got a way of getting a file's path from the user. ...

Relative Path in master page for img tag

I have a tag in a master page. I use this master page in many folders. So the src path of the tag should be different for each folder. Here is my code : <img src="images/1.gif" /> and I have a folder named "images" and a folder named "Users". Master Page is in the root, but I use it in Users folder. How can I set a dynamic address ...

Relative paths with NCover and MSTest.exe

I know this is stupid, but I can't figure it out. In our solution, we specify the relative paths to a file one of our tests needs as - ../../../TestSuite/IniTestFiles/LocalRedir1.xml Now, this works fine when running the testing out of VS with MSTest.exe. However, in NCover all of the tests fail. Does anyone know how I can go about fix...

How to properly make path handling robust in a bash program?

The script have some hard-coded relative paths. I would like them to be relative to script position. The script needs to change current directory as some other program (cmake) needs it. The script takes some (possibly relative to caller) paths as an argument and it passes them to that program, they should be derelativized. Questions a...

how to obtain the relative path of a resource in a j2ee project

I have a Dynamic Web Project having a flat file (or say text file). I have created a servlet in which I need to use this file. My code is as following: protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // String resource = request.getParameter ("json") ; ...

Validating XML with multiple XSD using relative paths in .NET

I'm trying to write a generic VB.NET (VS2005) function to validate an XML document against an XSD. This works fine until I use an XSD with a relative path include like: <xs:include schemaLocation="test.02.xsd" /> It can never seem to find what is included in any secondary documents. Here is my original function below. I've been pla...

Wrong extraction of .attr("href") in IE7 vs all other browsers?

Can it really be true that the attr("href") command for a link is handled very different in IE7 in comparison to all other browsers? Let's say I have a page at http://example.com/page.html and I have this HTML: <a href="#someAnchor" class="lnkTest">Link text</a> and this jQuery: var strHref = $(".lnkTest").attr("href"); Then in IE...

Relative path in JLabel HTML

Hi, I am trying to make JLabel show an html which is referencing an image using a relative path. But I cannot make JLabel locate the image. It works fine when I am using absolute path. I have tried running the program from the command line or from eclipse and add dialog to show me where is the current working directory but for avail. I ...

Unix paths: officially work in Python for any platform?

Can all paths in a Python program use ".." (for the parent directory) and / (for separating path components), and still work whatever the platform? On one hand, I have never seen such a claim in the documentation (I may have missed it), and the os and os.path modules do provide facilities for handling paths in a platform agnostic way (o...

Relative URLs in Sharepoint master page

I have a master page with tabs. The tabs are defined by the following sitemap file: <siteMap> <siteMapNode title="Home" url="~/" > <siteMapNode title="Schedule" url="~/Pages/Tab2.aspx"/> <siteMapNode title="Deliverables" url="~/Pages/Tab3.aspx"/> <siteMapNode title="My Items" url="~/Pages/Tab4.aspx"/> ...

Batch File: Resolve Absolute Path from Relative Path and/or File Name

In a Windows Batch script is there any way to return an absolute path from a value containing a filename and/or relative path? Given: "..\" "..\somefile.txt" I need the absolute path relative to the batch file. Example: "somefile.txt" is located at "C:\Foo\" "test.bat" is located in "C:\Foo\Bar". User opens a command window at "C...

Nested Masterpages and CSS files

Hello, I have two masterpages. A main.Master and a search.Master. The search.Master is a nested masterpage, which is "inside" the main.Master. To get my CSS files work with masterpages, I had to place the runat="server" atribute. Like this: <link runat="server" href="~/mp/css/master.main.css" rel="stylesheet" type="text/css" /> And ...

Find a path in Windows relative to another

This problem should be a no-brainer, but I haven't yet been able to nail it. I need a function that takes two parameters, each a file path, relative or absolute, and returns a filepath which is the first path (target) resolved relative to the second path (start). The resolved path may be relative to the current directory or may be absol...