path

Retrieving paths of FileSystemInfo instances

How does one retrieve ( or resolve, for that matter ) the absolute and relative ( FullPath and OriginalPath fields ) paths of FileSystemInfo/DirectoyInfo/FileInfo instances ? I'm trying to get the paths of the files/directories returned by a FileSystemInfos call on a DirectoryInfo class object. ...

Specifying relative path in py2exe

When specifying my script file in setup.py, e.g. "script": 'pythonturtle.py', how can I specify its relative position in the file system? In my case, I need to go down two folders and then go into the "src" folder and it's in there. How do I write this in a cross-platform way? ...

Quickest way to find substrings in text files

What's the fastest way to find strings in text files ? Case scenario : Looking for a particular path in a text file with around 50000 file paths listed (each path has it's own line). ...

canonicalize a path name on solaris

On a GNU system I would just use readlink -f $SOME_PATH, but Solaris doesn't have readlink. I'd prefer something that works well in bash, but other programs are ok if needed. Edit: The best I've come up with so far uses cd and pwd, but requires some more hackery to deal with files and not just directories. cd -P "$*" REAL_PATH=`pwd` ...

To have LaTeX-like PATH -system for PHP development

I develop my project at ~/Dropbox/db/. I need to move the folder continuously to /var/www to be able to see the result in Firefox because it is the only place where I have Apache. My filetree is at ~/Dropbox/db/ . |-- handlers | |-- login.php | |-- question.php | |-- question_answer.php | `-- register.php |-- index.php |-- form...

Which path module or class do Python folks use instead of os.path?

Just wondering how many people use a path module in Python such as Jason Orendorff's one, instead of using os.path for joining and splitting paths? Have you used: Jason's path module (updated for PEP 355) Mike Orr's Unipath, basically a more modern version of the above Noam Raphael's alternative path module that subclasses tuple instea...

How do I properly split a PATH variable in PHP?

I want to split $path = getenv('PATH'); into its components. How do I determine the separator char in an os-dependent fashion? ...

Path2D fill and draw algorithm

Hi, Does somebody know the algorithm that is been used to fill or draw a Path2D (GraphicsPath in .NET) object with a Graphics2D-object (Graphics in .NET). The algorithm isn't public in the Java-sources and .NET isn't public at all. I want to use it for some fast image-operations. Thnx ...

how to print python location(where python is install) in the output

Lets say Python is installed in the location "C:\TOOLS\COMMON\python\python252" . I want to print this location in the output of my program. Please let me know which is the function for doing this. Thank you very much. ...

Python - how to refer to relative paths of resources when working with code repository

We are working with a code repository which is deployed both to windows and linux, sometimes on different directories. How should one of the modules inside the project refer to one of the non-python resources in the project (CSV file, etc.)? If we do something like thefile=open('test.csv') or thefile=open('../somedirectory/test.csv')...

jquery ajax & full server path

Is there a way to use a full server path instead of a url when submitting a form via ajax with jquery? The exemple below doesn't work but it will give you an idea of what I'm trying to do. I know you can't do cross domain ajax requests but this is all on the same physical server. I don't want to set up proxy or anything too fancy, if t...

Correct InstallUtil Path To File Syntax?

I'm trying to install a Windows Service using a batch file, let's call it "installservice.bat". Inside the file I have the following commands: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe -i ".\MyService.exe" pause When I excute the batch file (running as administrator on Vista) I get this: Exception occurred whil...

How can code in a JavaScript file get the file's URL?

I need to dynamically load a CSS stylesheet into a page that's on a different domain. How can I get the complete URL of the JS file to use in the href attribute of the stylesheet? For instance, here is the structure: http://bla.com/js/script.js http://bla.com/css/style.css I want to dynamically load the stylesheet into a page http:...

Get Drupal Paths During node 'insert' operation with Pathauto enabled?

I'm writing a module that interfaces with Google Base. It needs to insert a link to the page that the item is on, however, this item has no path until pathauto runs. How can I either make sure pathauto runs its hooks before my module does, or get the path that will result from pathauto?. The solution needs to be generic enough to wo...

Document Directory on iPhone is invalid

I attempt to get the path of the document directory on the iPhone SDK with the following code: NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); I'm in distribution and not debug configuration. In debug a valid path is returned. Also I'm using iPhone OS 3.0 Please help! Joe ...

Longest pathname string in Mac OS X HFS+

I'm trying to find a definitive answer (e.g. Apple developer documentation) for the maximum length of a complete path string on Mac OS X. I've seen various non-authoritative sites that state that it is unbounded, 4096 characters, or 1024 characters, but haven't been able to find an answer on Apple's web site. ...

XCode include paths

I'm having a problem getting XCode to deal with a particular file structure that I am using or that I wish to use. I have a set of files in the following form... Library Headers Library Package1 Header1.h Header2.h HeaderN.h Package2 Header1.h Hea...

g++ not working on Windows command prompt

Hello, I try to use Eclipse as an IDE for C programming. Hence, I installed cygwin successfully thereby getting gcc,gdb, and make tools. I'm able to execute C programs on cygwin, however I can't do that on Command prompt. I know, there must be a problem related to Path. But I added C:\Cygwin\bin;C:\Cygwin\usr\bin to the path. I double-c...

File paths with non-ascii characters and FileInfo in C#

I get a string that more or less looks like this: "C:\\bláh\\bleh" I make a FileInfo with it, but when I check for its existence it returns false: var file = new FileInfo(path); file.Exists; If I manually rename the path to "C:\\blah\\bleh" at debug time and ensure that blah exists with a bleh inside it, then file.Exists starts...

Reading properties file from JAR directory

I’m creating an executable JAR that will read in a set of properties at runtime from a file. The directory structure will be something like: /some/dirs/executable.jar /some/dirs/executable.properties Is there a way of setting the property loader class in the executable.jar file to load the properties from the directory that the jar is...