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
14
votes
3 answers

How can I get MIDL to search additional include directories for qualified paths

Update: Just over six months after opening a support call to Microsoft it has been rejected, they claim it is not a bug (since the documentation doesn't explicitly say that the behaviour seen isn't the correct one). They rejected the DCR saying that…
Motti
  • 110,860
  • 49
  • 189
  • 262
14
votes
2 answers

prawn - import image from URL

I can't seem to figure out how to import an image from an url To import the images from my localhost I use: image"./assets/images/img.png" When I replace the path with an URL it says `image' : URL not found Is there a solution for this, or should…
Wijnand
  • 1,192
  • 4
  • 16
  • 28
14
votes
3 answers

What is the difference between an absolute and a relative path?

I am asking because I am working on a project for school. Yes this is homework. But, I'm trying to understand a little bit more, though. This is one example of what is being asked. • When the user clicks the “Save” button, write the selected…
shan
  • 1,311
  • 4
  • 13
  • 17
13
votes
7 answers

Checking for relative vs absolute paths/URLs in PHP

I need to implement functions to check whether paths and urls are relative, absolute, or invalid (invalid syntactically- not whether resource exists). What are the range of cases I should be looking for? function check_path($dirOrFile) { // If…
Yarin
  • 173,523
  • 149
  • 402
  • 512
13
votes
1 answer

Relative path in ASP.NET

Make Games with Scirra Software
Tom Gullen
  • 61,249
  • 84
  • 283
  • 456
13
votes
2 answers

When to use Absolute Path vs Relative Path in Python

For reference. The absolute path is the full path to some place on your computer. The relative path is the path to some file with respect to your current working directory (PWD). For example: Absolute path: C:/users/admin/docs/stuff.txt If my PWD…
samGon
  • 131
  • 1
  • 1
  • 3
13
votes
3 answers

How to link your own articles on a Pelican blog?

I tried to link with the html file name, but it works because they are on the same folder. [Title](./this-is-the-file.html) But it is possible that another article would appear on another folder because of the ARTICLE_URL pattern. Examples: [Title…
jordiburgos
  • 5,964
  • 4
  • 46
  • 80
13
votes
4 answers

how to read text file relative path

I have read sources here & there, but did not get the following code working. Basically, I wish to read a text file, named 'Administrator' from the folder 'src'. I will need a relative path, since this project may be transferred to another person.…
user2945412
  • 297
  • 1
  • 3
  • 13
13
votes
4 answers

PHP - Relative paths "require"

My directory structure looks like this: blog -> admin -> index.php blog.php db.php functions.php I have been trying to include (require, really) blog.php in the admin/index.php, but facing lots of errors. I'm following a PHP course, and the…
Rafay
  • 23,785
  • 4
  • 20
  • 27
13
votes
6 answers

Open file with fopen, given absolute path on Windows

I'm trying to make a program that counts the number of lines of a file, when I try to pass the absolute path to the fopen function, is simply tells me that is not found, here is my code: #include #include #include…
franvergara66
  • 10,524
  • 20
  • 59
  • 101
12
votes
2 answers

Resolving relative paths with wildcards in C#

In C#, if I have a directory path and a relative file path with wildcard, e.g. "c:\foo\bar" and "..\blah\*.cpp" Is there a simple way to get the list of absolute file paths? e.g. { "c:\foo\blah\a.cpp", "c:\foo\blah\b.cpp" } Background There is a…
NS.X.
  • 2,072
  • 5
  • 28
  • 55
12
votes
1 answer

Relative files paths in doxygen-generated documentation

I am using Doxygen 1.7.4 for Windows. In the File List page of generated documentation I'd like to see relative paths. I have set FULL_PATH_NAMES = YES, to have something more, than just filename without path, but this gives full, absolute…
Soul Reaver
  • 2,012
  • 3
  • 37
  • 52
12
votes
3 answers

Relative path in Google Drive mounted in Google Colab

I have a Google Colab notebook that I want to distribute to other users, and I want to include relative paths for files and directories in my mounted Google Drive so that the code doesn't break when they put it in a different directory than the one…
rchurt
  • 1,395
  • 1
  • 10
  • 21
12
votes
3 answers

Get relative Path of a file C#

I currently writing a project in visual studio in c#. the project full path is: "C:\TFS\MySolution\" I have a file that I need to load during the execution. lets say the file path is "C:\TFS\MySolution\Project1\NeedtoLoad.xml" I don't want to…
Dan The Man
  • 1,835
  • 6
  • 30
  • 50
12
votes
4 answers

How to use Server.MapPath to get location outside website folder in ASP.NET

When my ASP.NET site uses documents (e.g. XML), I normally load the document as follows: Server.MapPath("~\Documents\MyDocument.xml") However, I would like to move the Documents folder out of the website folder so that it is now a sibling of the…
David
  • 15,750
  • 22
  • 90
  • 150