Questions tagged [relative-path]

Relative-paths are URI or directory links to resources that refer to a location relative to the current path.

A relative path references a resource in relation to a current path or directory; its opposite is an absolute path. Web pages frequently make use of relative paths to refer to resources like images and scripts. The advantage of using a relative path is that it remains valid when the host name or root path changes.

As an example, consider a website located at the URL:

http://www.hostname.com/site/page.html

If the page wants to reference an image located at:

http://www.hostname.com/site/images/image.jpg

It could simply make reference to the relative path images/image.jpg.

2470 questions
81
votes
27 answers

Info.plist Utility Error: "Info.plist couldn't be opened because there is no such file"

I'm running into what seems to be common error, in that Xcode can't seem to find my 'Info.plist' file. I've checked the answers to these two StackOverflow questions (Could not read from Info.plist and Objective C/Xcode error: The file “Info.plist”…
narner
  • 2,908
  • 3
  • 26
  • 63
80
votes
6 answers

How to use relative paths without including the context root name?

To working my static file (CSS, JS) I have to write absolute path like /AppName/templates/style/main.css. Is there any solution, that I could write relative path like style/main.css?
kspacja
  • 4,648
  • 11
  • 38
  • 41
78
votes
5 answers

Why would a developer place a forward slash at the start of each relative path?

I am examining some code for a friend, and have found that the developer who built his site began each and every relative src, href, and include with a forward slash /. For example: src="/assets/js/jquery.js" I have never seen this before. So my…
stefmikhail
  • 6,877
  • 13
  • 47
  • 61
72
votes
13 answers

webpack: Module not found: Error: Can't resolve (with relative path)

I have this structure of an app (node_modules dir excluded from this list): ├── actions.js ├── bundle.js ├── components │   ├── App.js │   ├── Footer.js │   ├── Link.js │   ├── Todo.js │   └── TodoList.js ├── Containers │   ├── AddTodo.js │   ├──…
Andrius
  • 19,658
  • 37
  • 143
  • 243
72
votes
18 answers

How to open my files in data_folder with pandas using relative path?

I'm working with pandas and need to read some csv files, the structure is something like this: folder/folder2/scripts_folder/script.py folder/folder2/data_folder/data.csv How can I open the data.csv file from the script in scripts_folder? I've…
Luis Ramon Ramirez Rodriguez
  • 9,591
  • 27
  • 102
  • 181
72
votes
6 answers

How do I use a relative path in Xcode project settings?

How do I use a relative path in Xcode project settings?
Shay
  • 2,595
  • 3
  • 25
  • 35
68
votes
3 answers

How to import a Python module from a sibling folder?

I have gone through many Python relative import questions but I can't understand the issue/get it to work. My directory structure is: Driver.py A/ Account.py __init__.py B/ Test.py __init__.py Driver.py from B import…
Joshua
  • 1,516
  • 2
  • 22
  • 31
67
votes
8 answers

How do I "use" a Perl module in a directory not in @INC?

I have a module in the parent directory of my script and I would like to 'use' it. If I do use '../Foo.pm'; I get syntax errors. I tried to do: push @INC, '..'; use EPMS; and .. apparently doesn't show up in @INC I'm going crazy! What's wrong…
Frew Schmidt
  • 9,364
  • 16
  • 64
  • 86
65
votes
6 answers

Batch files: List all files in a directory with relative paths

Concerning Windows batch files: Is there a way to list all the files (or all of a specific type) in a certain directory and its subdirectories, including the paths relative to the current (or the search) directory in the list? For example, if I want…
Tim Meyer
  • 12,210
  • 8
  • 64
  • 97
65
votes
5 answers

InputStream from relative path

I have a relative file path (for example "/res/example.xls") and I would like to get an InputStream Object of that file from that path. I checked the JavaDoc and did not find a constructor or method to get such an InputStream from a path/ Anyone has…
Allan Jiang
  • 11,063
  • 27
  • 104
  • 165
63
votes
7 answers

Include relative files in PowerShell

I would like to include script files with such pseudo syntax: Include '.\scripA.ps1' But the only thing I have found is some thing like this: $thisScript = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent . ($thisScript +…
alex2k8
  • 42,496
  • 57
  • 170
  • 221
62
votes
5 answers

How can I get MSBUILD to evaluate and print the full path when given a relative path?

How can I get MSBuild to evaluate and print in a task an absolute path given a relative path? Property Group ..\..\..\Public\Server\ c:\Program Files (x86)\Program\ Task
Eric Schoonover
  • 47,184
  • 49
  • 157
  • 202
61
votes
3 answers

Relative paths with fetch in Javascript

I was surprised by an experience with relative paths in JavaScript today. I’ve boiled down the situation to the following: Suppose you have a directory structure like: app/ | +--app.html +--js/ | +--app.js …
user2467065
60
votes
9 answers

How to define a relative path in java

Here is the structure of my project : I need to read config.properties inside MyClass.java. I tried to do so with a relative path as follows : // Code called from MyClass.java File f1 = new File("..\\..\\..\\config.properties"); String path =…
ishk
  • 1,873
  • 5
  • 19
  • 22
59
votes
5 answers

Symlink broken right after creation

I downloaded the linux Tor Browser package, which is a self-contained folder. I made a symlink to the run script: $ ln -s torbrowser/start-tor-browser ~/bin/torbrowser However, the link was broken upon creation. All I did was run that command,…
joshlf
  • 21,822
  • 11
  • 69
  • 96