path

Visual Studio 2008, dumb problem with relative paths

What's happening to me is, when I run my program out of Visual studio, it can't use relative paths to find anything. This is proving difficult to articulate... Like, I've got program X, which opens textfile.txt, right? And if I point to textfile.txt with an absolute path, I'm fine. And if I point to it with a relative path and I compil...

Resolving a relative url path to it's absolute path

Is there a library in python that works like this? >>> resolvePath("http://www.asite.com/folder/currentpage.html", "anotherpage.html") 'http://www.asite.com/folder/anotherpage.html' >>> resolvePath("http://www.asite.com/folder/currentpage.html", "folder2/anotherpage.html") 'http://www.asite.com/folder/folder2/anotherpage.html' >>> resol...

Algorithm to find two points furthest away from each other

Im looking for an algorithm to be used in a racing game Im making. The map/level/track is randomly generated so I need to find two locations, start and goal, that makes use of the most of the map. The algorithm is to work inside a two dimensional space From each point, one can only traverse to the next point in four directions; up, dow...

Detect executable folder from SDL

I am creating a C++ SDL game engine, and it is relevant to know the executable path since images and other resources are not stored within the executable - they are in a separated folder("res/"). Under Linux, I am using a shell script "rungame.sh" that cd's to the executable path and then runs the executable(using then "./" to reference...

PHP Errors on Making Local Copy of Server

I have a site that I am trying to create a local copy of for test purposes (dusting off a past site). I was able to correctly get the db out and most of the site works great. However, I have places where things aren't loading correctly and are just giving me errors or messages in curly braces. For example, a td class' name is being re...

How do you convert a url to a virtual path in asp.net without manual string parsing?

I've seen similar questions and answers regarding conversions from virtual to absolute and url, but how can I convert a url to a virtual path without manual string parsing? Example: I want "http://myserver/home.aspx" converted to: "~/home.aspx" I realize the above example would be an easy string parsing routine, but I'm looking for a...

How to normalize a path in PowerShell?

I have two paths: fred\frog and ..\frag I can join them together in PowerShell like this: join-path 'fred\frog' '..\frag' That gives me this: fred\frog\..\frag But I don't want that. I want a normalized path without the double dots, like this: fred\frag How can I get that? ...

problem while running batch file that is present in the remote system

Hi, My requirement is that i need to run batch file that is present in remote system from local machine. i am having the following code. But it is giving the following error :Path not correct". I have the ip address of the machine, and i have given the batch file as public share and share name is dsc. ip address of the machine is 16.18...

Best way of getting path to "Application Data" directory?

There are several possible ways of getting the path to the application data directory: using the %APPDATA% environment variable calling SHGetFolderPath with CSIDL_APPDATA What is the best way to get the path from within an program? Are there any gotchas when I use the environment variable? Which method is safest across XP, Vista and...

Relative filepath with HttpWebRequest object

Hi, I am trying to create unittests that can be shared amongst my development team so I need to have all paths in the project be relative. Where this is giving me trouble is with the HttpWebRequest class. I want it to serve static testdata from a file in the local filesystem. I'd like to do something like this: file:///./TestData/te...

Meaning of Path Structure on Unix

Hello, Does anybody have a reference to what the various path names mean on different flavors of Unix? Please include Solaris, RHEL, and SLES in the list if possible. e.g. From what I have gathered /lib is standard libraries for the distribution, which never change (is this correct? or do they get new versions from time to time?), /...

Relative Paths Not Working in Xcode C++

There are numerous post over the net that detail how relative paths don't work in Xcode. I do have an Xcode template that I downloaded where the relative paths DO work, however I have not been able to figure out why nor replicate it in other projects. Firstly, I am using C++ in Xcode 3.1. I am not using Objective-C, nor any Cocoa/Carbon...

Execute a string as a command in python

I am developing my stuff in python. In this process I encountered a situation where I have a string called "import django". And I want to validate this string. Which means, I want to check whether the module mentioned('django' in this case) is in the python-path. How can I do it? ...

What is the correct way to check if a path is an UNC path or a local path?

The easiest way to check if a path is an UNC path is of course to check if the first character in the full path is a letter or backslash. Is this a good solution or could there be problems with it? My specific problem is that I want to create an System.IO.DriveInfo-object if there is a drive letter in the path. ...

Is there a way to set the environment path programatically in C++ on Windows?

Is there a way to set the global windows path environment variable programatically (C++)? As far as I can see, putenv sets it only for the current application. Changing directly in the registry (HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment) is also an option though I would prefer API methods if there are? ...

OpenTextFile on a remote computer

Hello I'm trying to read remote text files using this code: function defdate(ipaddress) deffilePath = chr(34) & "\\" & ipaddress & "\c$\" & deffileName & chr(34) wscript.echo deffilePath set deffile = objFSO.OpenTextFile(deffilePath) do while not deffile.endofstream s=deffile.readline wscript.echo s loop deffile.c...

Win32API function to join directories ?

Does the Win32 API have a function for joining two paths? I can't find it, so I thought I'd ask before rolling my own. ...

What is the most correct regular expression for a UNIX file path?

What is the most correct regular expression (regex) for a UNIX file path? For example, to detect something like this: /usr/lib/libgccpp.so.1.0.2 It's pretty easy to make a regular expression that will match most files, but what's the best one, including one that can detect escaped whitespace sequences, and unusual characters you don'...

Using FolderBrowserDialog on a Removable Device / Removable storage

I'm working on a simple copy tool to copy files off digital cameras. I've written the file copy code, I've got everything hooked up nicely. The issue I have seems to be with the FolderBrowserDialog. In Vista (I haven't checked XP yet), I can browse to the directories on the camera. However the FolderBrowserDialog will not let me select ...

Why Powershell Environment PATH is different than the actual Environment PATH?

I'm having this weird situation : My user's and system's PATH variable is different than the PATH in powershell. When I do : PS C:\$env:path C:\Windows\System32\WindowsPowerShell\v1.0\;c:\oldpath However this is not correct, it looks like it stuck on some old PATH variable of my system, so none of the udpates I've done on it didn't...