absolute-path

gcc/gdb: How to embed absolute path to source file in debug information?

hello. i am just wondering if i can tell gcc to embed the absolute path to a source file in the debug information, even if i call gcc like gcc -g ../src/somecode.c -o ../bin/somecode.o as i see it atm, gcc just stores what you provide, so if you provide a relative path, at the end, gdb only knows the relative path as well. is there ...

Get the absolute path of a file to be uploaded

This is driving me crazy, and I feel like I should know this, but for some reason it's just not coming to me. I scoured the related questions but no dice. I am uploading a file using a simple FileUpload control named theFile (ASP.NET). I'm trying to get the absolute path of the file, but thefile.PostedFile.FileName and thefile.FileName ...

How to remove extension and force trailing slash with .htaccess

I managed to solve this problem by the following code: RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{THE_REQUEST} ^GET\ /[^?\s]+.php RewriteRule (.*).php$ /$1/ [L,R=301] RewriteCond %{REQUEST_FILENAME} !-d RewriteRule (.*)/$ $1.php [L] RewriteCond %{REQUEST_FILENAME}.php -f RewriteRule .*[^/]$ $0/ [L,R=301] In other words, no...

Is there a portable way of finding if a path is absolute, using Python?

Is there some built-in function that tells me if a path is absolute or not? I'd like something that is platform independent. ...

What Perl module(s) do I use to obtain an absolute path (including filename) from a relative one on Windows?

I can only imagine I'm not searching correctly; this seems like an obvious question to be asked here. My apologies if this is a duplicate. I'm writing a Perl program that will take a filename as a command-line argument. I need to convert the filename (or the filename with a relative path attached) to an absolute path (specifically to wo...

Is using absolute paths for images/scripts a good idea?

Hi, I have a website which I am updating the URLs for i.e. rewriting to be more SEO friendly. By doing this, it has broken a lot of the links to scripts/images on the various pages. The only way around this (from what I can tell) is to use the absolute path to the scripts/images on the pages. Now unless I am mistaken (or missing someth...

What's a good Perl regex to untaint an absolute path?

Well, I tried and failed so, here I am again. I need to match my abs path pattern. /public_html/mystuff/10000001/001/10/01.cnt I am in taint mode etc.. #!/usr/bin/perl -Tw use CGI::Carp qw(fatalsToBrowser); use strict; use warnings; $ENV{PATH} = "bin:/usr/bin"; delete ($ENV{qw(IFS CDPATH BASH_ENV ENV)}); I need to open the same...

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...

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...

Dreamweaver changing path to site's reference instead of local

I have noticed recently, when I apply a template to a new HTML website, all the relative paths are pointed to my local files, example: file:///C|/webstuff/files but I cannot set them to relative paths that are pointed to my server, http://www.websitehere.com/ I have read that some versions of Dreamweaver will not allow this, can anyone c...

Apache 400 Absolute Path for Blogs

Here is an example of a blog with this issue. It uses Apache to send a 400 error, but keep the url as is. Is there a way in Apache using a .htaccess file to keep the url as is so the PHP script can do as needed with it, but not send a 400 error? The site works fine in some browsers, but those like IE and mobile browsers have there own...

how to get absolute path of a different server

hi! We have hosted some downloadable files on our different server due to bandwidth problem. Now we want to download those files using an ASP script from our current server. But how could we know the absolute path of that particular server using ASP script ? regards sk ...

x-code copying project to another computer problem

Hi there Im having problems copying a project over from one mac to another. The project compiles and runs fine after being copied, however xcode seems to have some duplicate of the same classes which seem to be invisible on the project browser on the left. For example if I jump to definition on a variable I get 2 suggestions pop up. Th...

Convert a Relative URL to an Absolute URL in Actionscript / Flex

I am working with Flex, and I need to take a relative URL source property and convert it to an absolute URL before loading it. The specific case I am working with involves tweaking SoundEffect's load method. I need to determine if a file will be loaded from the local file system or over the network from looking at the source property, a...

PHP on Plesk - Can't see absolute directories

I have PHP installed on a web server administered by Plesk. I am having some PHP include_path problems which I have narrowed down to absolute paths apparently not working. So, if I try to do a directory listing, the following works: echo "<h3>Directory listing of .</h3>"; foreach (new DirectoryIterator('.') as $fileInfo) { if($file...

Change a relative URL to absolute URL in Objective C

Hi. How would I take a file in the application's directory (the same folder the .app is in), and get it's absolute path. Say the relative path is "Data/file.txt," how would I use Objective C to get that as an absolute path? I have the user enter their home folder name, if that is any help. Please help, HiGuy ...

How to get the file-path of the currenctly 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). Is there any way for the javascript to know that? Alternatively, is there any good way to lo...

How to get the absolute path for a given relative path programmatically in Linux?

How to get the absolute path for a given relative path programmatically in Linux? Incase of Windows we have the _fullpath() API. In other words, I mean what is analogous API to _fullpath of Windows in Linux? ...

Absolute to Relative File Path in Java

Given I have two File objects I can think of the following implementation: public File convertToRelative(File home, File file) { final String homePath = home.getAbsolutePath(); final String filePath = file.getAbsolutePath(); // Only interested in converting file path that is a // direct descendants of home path if ...

ASP.Net MVC2: Where can I store a file to be able to access it on both my dev box and in production?

I need to store a file, such that my ASP.Net MVC app can access the file, both when I run the website in visual studio, and when the production server is actually running. I don't think that I can do relative pathing on my dev box, because the execution path is something in the System32 folder. I don't know if the same is true on the ser...