Questions tagged [absolute-path]

global address for a file, independent from the working directory of the calling process

An absolute (or full) path is the general form of the name of a file or directory that specifies a unique location in a file system. An absolute path contains the root directory and all other subfolders in which the requested file or folder is contained.

833 questions
86
votes
12 answers

How to get the file-path of the currently executing javascript code

I'm trying to do something like a C #include "filename.c", or PHP include(dirname(__FILE__)."filename.php") but in javascript. I know I can do this if I can get the URL a js file was loaded from (e.g. the URL given in the src attribute of the tag).…
B T
  • 57,525
  • 34
  • 189
  • 207
83
votes
6 answers

how to find the target file's full(absolute path) of the symbolic link or soft link in python

when i give ls -l /etc/fonts/conf.d/70-yes-bitmaps.conf lrwxrwxrwx /etc/fonts/conf.d/70-yes-bitmaps.conf -> ../conf.avail/70-yes-bitmaps.conf so for a symbolic link or soft link, how to find the target file's full(absolute path) in…
duhhunjonn
  • 44,855
  • 11
  • 28
  • 15
71
votes
5 answers

constructing absolute path with os.path.join()

I'd like to construct an absolute path in python, while at the same time staying fairly oblivious of things like path-separator. edit0: for instance there is a directory on the root of my filesystem /etc/init.d (or C:\etc\init.d on w32), and I want…
umläute
  • 28,885
  • 9
  • 68
  • 122
64
votes
7 answers

Converting relative path into absolute path?

I'm not sure if these paths are duplicates. Given the relative path, how do I determine absolute path using a shell script? Example: relative path: /x/y/../../a/b/z/../c/d absolute path: /a/b/c/d
josh
  • 13,793
  • 12
  • 49
  • 58
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
62
votes
5 answers

Do I need to pass the full path of a file in another directory to open()?

I have a folder with ten files in it which I want to loop through. When I print out the name of the file my code works fine: import os indir = '/home/des/test' for root, dirs, filenames in os.walk(indir): for f in filenames: …
balcoder
  • 719
  • 1
  • 8
  • 14
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
55
votes
3 answers

Slash (/) vs tilde slash (~/) in style sheet path

ASP.NET offers two ways to specify paths for style sheets: (this is working) (this is not working) How are these…
Kyasa Madhavi
  • 705
  • 1
  • 6
  • 10
51
votes
8 answers

Relative instead of Absolute paths in Excel VBA

I have written an Excel VBA macro which imports data from a HTML file (stored locally) before performing calculations on the data. At the moment the HTML file is referred to with an absolute path: Workbooks.Open FileName:="C:\Documents and…
Gene
  • 635
  • 1
  • 6
  • 6
49
votes
5 answers

Asp.Net Absolute Path of a URL

To make it simpler for a webapp to share files with another app on a different server, I'm using a base href tag in my master page. As many people have discovered, this breaks webform paths. I have a working Form Adaptor class but am not sure how…
Brian
  • 25,523
  • 18
  • 82
  • 173
49
votes
3 answers

How to force an HTML link to be absolute?

In my website, users can put an URL in their profile. This URL can be http://www.google.com or www.google.com or google.com. If I just insert in my PHP code $url, the link is not always absolute. How can I force the a tag to be…
Arnaud
  • 4,884
  • 17
  • 54
  • 85
47
votes
8 answers

PHP absolute path to root

I can't believe PHP doesn't have an easy solution for this simple matter. ASP.NET has a ~ sign that takes care of this issue and starts everything from the root level. Here's my problem: localhost/MySite -->Admin -- Edit.php -->Class …
SZT
  • 1,771
  • 4
  • 26
  • 53
40
votes
4 answers

Get path of Android resource

My question is: is it possible to get the absolute path of a resource (in a subdirectory of the res/ folder) in Android? Most of the answers I see to this question on google suggest getting a file descriptor, implying that this is not possible. Is…
Prime
  • 4,081
  • 9
  • 47
  • 64
40
votes
8 answers

Nodejs absolute paths in windows with forward slash

Can I have absolute paths with forward slashes in windows in nodejs? I am using something like this : global.__base = __dirname + '/'; var Article = require(__base + 'app/models/article'); But on windows the build is failing as it is requiring…
Megh Parikh
  • 924
  • 2
  • 7
  • 25
38
votes
5 answers

src absolute path problem

I have an image in C:\wamp\www\site\img and i try to display it in a page with this: but it's not working.The file is actually there and if I try to refer to it with a relative path i got the…
luca
  • 36,606
  • 27
  • 86
  • 125
1
2
3
55 56