absolute-path

Obtaining full name of PDF file from within Acrobat

When I open a PDF document in Acrobat Pro, how can I obtain the full name of the file including its absolute location (full directory listing)? For example, if I open up myfile.pdf, I want to know that its full name is S:\Company Data\Reports\Project1\myfile.pdf . The Document Properties lists both the short file name (myfile.pdf) a...

getting base url of web site's root (absolute/relative url)

I want to completely understand how to use relative and absolute url address in static and dynamic files. ~ : / : .. : in a relative URL indicates the parent directory . : refers to the current directory / : always replaces the entire pathname of the base URL // : always replaces everything from the hostname onwards This example ...

BASH: Convert absolute path into relative path given a current directory

absolute="/foo/bar" current="/foo/baz/foo" # magic relative="../../bar" Can you help me with magic? (Hopefully not too complicated code...) ...

Relative path from an ASP.NET user control NavigateUrl

I have a user control that contains a GridView. The GridView has both a HyperLinkField column and a template column that contains a HyperLink control. The ASP.NET project is structured as follows, with the Default.aspx page in each case using the user control. Application Root Controls UserControl with GridView SystemAdminFolder D...

(Python) Why do I always have to type absolute paths in file functions?

For instance, if I have: C:\42\main.py and C:\42\info.txt and I want to read info.txt from main.py, I have to input "C:\42\info.txt" instad of just "info.txt". Is it supposed to be like that? If not, how can I fix it? ...

Relative Uri works for BitmapImage, but not for MediaPlayer?

This will be simple for you guys: var uri = new Uri("pack://application:,,,/LiftExperiment;component/pics/outside/elevator.jpg"); imageBitmap = new BitmapImage(); imageBitmap.BeginInit(); imageBitmap.UriSource = uri; imageBitmap.EndInit(); image.Source = imageBitmap; => Works perfectly on a .jpg with Build Action: Content Copy to Out...

getting the path of a javascript file

Hi, In a javascript file (e.g. script.js) I need a variable that contains the absolute path to this file. How can I do this dynamically? Thanks. ...

Relative to absolute paths in HTML (asp.net)

Hello all, I need to create a newsletters by URL. I to do next: Create a WebClient; Use WebClient's method DownloadData to get a source of page in byte array; Get string from source-html byte array and set it to the newsletter content. But I have some troubles with paths. All elements' sources were relative (/img/welcome.png) but I...

Mapping Absolute / Relative (Local) Paths to Absolute URLs

I need a fast and reliable way to map an absolute or relative local path (say ./images/Mafalda.jpg) to it's corresponding absolute URL, so far I've managed to come up with this: function Path($path) { if (file_exists($path) === true) { return rtrim(str_replace('\\', '/', realpath($path)), '/') . (is_dir($path) ? '/' : ''...

PHP Include Paths

Hi, I'm new to PHP and I'm having a problem when trying to link my CSS files using include. Basically I need my files to link back to a certain directory no matter how far down the file is. I have tried using <?php include $_SERVER['DOCUMENT_ROOT'] . '/sysprogs/required/header.html'; ?> But header.html contains the links to my ...

How to get absolute path from path with system path variables?

Is there an easy way to translate a path with system path variables to an absolute path? So %ProgramFiles%\Internet Explorer\hmmapi.dll becomes C:\Program Files\Internet Explorer\hmmapi.dll I like to know if there is an API call that can do this, or do I have to do this the hard way and detect %..% sequences and replace them with the c...

Could I do this blind relative to absolute path conversion (for perforce depot paths) better?

I need to "blindly" (i.e. without access to the filesystem, in this case the source control server) convert some relative paths to absolute paths. So I'm playing with dotdots and indices. For those that are curious I have a log file produced by someone else's tool that sometimes outputs relative paths, and for performance reasons I don't...

connection string reading data from excel in asp.net

Hello, I am trying to read data from excel file in asp.net. I have added the connection string to webConfig file: <add name="xls" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=HPM_DB.xls;Extended Properties=Excel 8.0"/> But it shows me an errormessage when I run this query: string query = "Select * from [IO_Definiti...

Regex to replace relative link with root relative link

I have a string of text that contains html with all different types of links (relative, absolute, root-relative). I need a regex that can be executed by PHP's preg_replace to replace all relative links with root-relative links, without touching any of the other links. I have the root path already. Replaced links: <tag ... href="path/to...

How do I get a pathname in ASP.NET?

Hi, I'm working on an internal web app and I need to get a directory path from the user. I (obviously) can use the asp:FileUpload to get a file but I can't find anything to just get a directory path. Is there any (preferably simple) way to have a directory-chooser dialog in asp.net? I haven't been able to find any solution on Google or...

Specifying relative paths in SPSS 18

In SPSS 11 it was possible to specify relative paths. Example: FILE HANDLE myfile='..\..\data\current.txt' /LRECL=533. DATA LIST FILE=myfile / ... This worked because apparently, SPSS 11 set the working folder to the path where the source .SPS file is saved. It seems that SPSS 18 always sets it's working folder to the installation fol...

Manipulating Directory Paths in Python

Basically I've got this current url and this other key that I want to merge into a new url, but there are three different cases. Suppose the current url is localhost:32401/A/B/foo if key is bar then I want to return localhost:32401/A/B/bar if key starts with a slash and is /A/bar then I want to return localhost:32401/A/bar finally if...

How get file path from std::ifstream in c++

Hi, I open a file using std::ifstream. I may open file using relative path (file.txt) or absolute path (C:\test\file.txt). As I am passing a string as the file name, I dont know whether it is relative or absolute path. Can anybody tell me how to get absolute path after file has been successfully open using std::ifstream ? e.g.: st...

one port number for one directory

My current place of employment uses the MS stack, and when creating ASP sites, the server listens on a specific port number for each project ie localhost:1525 will point to one project and localhost:1526 will point to another. I can achieve something similar on the LAMP stack with setting the config files manually, but is there a way to...

PHP: Require path does not work for cron job?

I have a cron job that needs to include this file: require '../includes/common.php'; however, when it is run via the cron job (and not my local testing), the relative path does not work. the cron job runs the following file (on the live server): /home/username123/public_html/cron/mycronjob.php and here's the error: Fatal error: re...