path

So what IS the right direction of the path's slash (/ or \) ?

it seems windows insist on writing this slash on files' path \, while .net's URI class writing this the other way? Is there any right way? that is accepted even in the most primitive systems? And why the .net's URI is showing the other slash than windows does? Thanks. ...

How should I combine two paths including backwards relative paths?

I have an absolute path, and a relative path, and I want to combine the two, is there any built-in way? The relative path can be as well "../../aa2/file.exe". (path.combine does not support it - which is pretty bizarre by itself.) ...

What's wrong with my random wandering algorithm?

I've created a 2 dimensional 'grid' for a game world I'm creating in Java. I'm having a problem with the 'wander' mode algorithm I've created. I noticed a problem that the objects would seem to favor the bottom right corner of the grid. I changed the algorithm and thought it was fixed. Today, while stress testing, I noticed that the p...

How do you consistently retrieve the path information from the query in php? (/index.php/foo/bar)

Basically if the user requests: index.php/foo/bar I need "/foo/bar" and for index.php I need "" or "/" I couldn't find any information on google because I don't know what this is called (path info got me the pathinfo() function) I found PHP_SELF returns differently if there is path info than if there is no info ...

How do I archive a set of files using Perl on Win32 while retaining file paths?

PROBLEM FOUND. I'm leaving the question here, though, in case others run into the same problem I ran into. It looks like I encountered a bug or a weird feature in WinZip 11. When I double click the test2.zip file to see its contents, WinZip tells me the path to the data file is "allcapsname" in lower case, but when WinZip extracts the ...

Printing basenames by Python

How can you print the basenames of files by Python in the main folder and subfolders? My attempt #!/usr/bin/python import os import sys def dir_basename (dir_name): for dirpath, dirnames, filenames in os.walk(dir_name): for fname in filenames: print os.path.basename(fna...

Relative paths in spring classpath resource

Hi all, I have a bunch of spring config files, all of which live under the META-INF directory in various subpackages. I have been using import like the following... <import resource="../database/schema.xml"/> So a relative path from the source file. This works fine when I am working with a local build outside of a jar file. But ...

How can I affect PATH in a makefile variable? Why is my example not working?

At the beginning of a makefile I have this line : PATH := $(PATH):/other/dir and this gives this error: Recursive variable 'PATH' references itself. What do I have to do so it works? ...

flash paths binding, constants

is it possible to use string as path ? instead of _parent._parent.myVar=123; use something like this: var path = '_parent._parent'; and then use it as path.myVar=123'; ...

Is the only way to list the "live" revisions of a particular SVN path "svn log -q -v" plus a filter?

Is performing an "svn log -q -v" across all revisions against the repository root and then filtering by the desired path really the best (only?) way to do this? We need to find these ranges in order to provide peg revisions to an automated tool and to add supporting detail to our change reporting. I have made a slight optimization to...

How to not discard a CDC path?

I draw some symbols, that belong to certain objects, into a device context and now want to be able to later test if the mouse cursor is above such a symbol. To do this, my plan was to first create a CDC path and use that to create a CRgn region object. pDC->BeginPath(); pDC->Ellipse(ellipse[0], ellipse[1], ellipse[2], ellipse[3]); // C...

Windows Standard File Locations

Could somebody point me to a document which lists all the standard file locations in windows and what one should and shouldn't use them for. Something like User Application Data -> %USERDIR%/AppData/Local/%VENDOR%/%APPLICATION% and so forth. ...

List all files in a directory with abosolute paths (excluding directories)

I've currently got: ls -1 $(pwd)/* Gives me all the files in a directory with absolute paths - but formats it with the directory at the start of each list of files. Is there a way just to get a list of files in a directory recursively (absolute paths) - excluding the directory/sub-directories themselves? ...

Where can I set path to make.exe on Windows?

When I try run "make" from cmd-console on Windows, it runs Turbo Delphi's make.exe but I need MSYS's make.exe. There is no mention about Turbo Delphi in %path% variable, maybe I can change it to MSYS in registry? Please, help. ...

Get Correct Relative Path in Delphi

Hi, I am writing with Delphi 2009 a little app to edit HTML files. With HypRef := '../../photos/myjpg.jpg' If FileExists(ExpandFileName(HypRef)) then ... I can find out, whether the file exists or not. Is there a function to find out the correct relative path, if FileExists gives a negative answer? ...

Calculating the path relative to some root- the inverse of Path.Combine

Is there a reliable way to calculate the inverse of Path.Combine()? Path.Combine("c:\folder", "subdirectory\something.txt") might return something like "c:\folder\subdirectory\something.text". What I want is the inverse, a function where Path.GetRelativeUrl("c:\folder", "c:\folder\subdirectory\something.text") would return something li...

Unix paths: officially work in Python for any platform?

Can all paths in a Python program use ".." (for the parent directory) and / (for separating path components), and still work whatever the platform? On one hand, I have never seen such a claim in the documentation (I may have missed it), and the os and os.path modules do provide facilities for handling paths in a platform agnostic way (o...

__init__.py descends dirtree for python, but not from c++; causes "import matplotlib" error.

Why or how does the file __init__.py cause the python interpreter to search subdirectories for a module -- and why does the interpreter not honor this convention when invoked from C++? Here's what I know: Using strace on my program, I can see that the same python2.5 interpreter is being executed for both the interactive case and the ...

how to get full path from fileupload using Javascript

Hi friends, I need to know how to get full path from fileupload using javascript, I tried using the following coding but of no use <input type="file" id="picField" onchange="preview(this)"> <script type="text/javascript"> function preview(test){ var source=test.value; alert(source); } </script> but in the alert message, i ...

php include virtual path

In my live site I have php include() and require() that have full path such as: /www/mysite.com/webapps/mmh/head.php or /www/mysite.com/webapps/ROOT/zip/BoundaryWizard.php Now, I want to do some local development on my windows machine (Xampp), so obviously none of those path work. Is there a way to tweak the apache or php settings to d...