49
голосов
8ответов
69224 просмотров

How can I find out where a Perl module is installed?

How do get the path of a installed Perl module by name, e.g. Time::HiRes? I want this just because I have to run my perl script on different nodes of a SGE Grid Engine system. Sometimes, even run as other username. I can use CPAN.pm to install packages for myself, but it is not so easy to insta...

2
голосов
2ответов
121 просмотров

Copying live sites to local

Recently I've been getting more and more into web development and as such have a few questions. I have a few websites that are on a production LAMP server and I've been trying to copy them to my local computer running xampp 1.7.1 on XP Pro. The problem I've been having is mostly path issues. I ma...

0
голосов
2ответов
2925 просмотров

Problem with drawing paths with Core Graphics - iPhone

I am trying to draw a map annotation in my app - very much like MapKit's MKAnnotationView, but without the mapkit. I have a problem with the ordering of the path for the view outline that I cant figure out. Image of results: http://img504.imageshack.us/img504/5458/screenshot20091010at703.png ...

206
голосов
7ответов
201189 просмотров

Convert file path to a file URI?

Does the .NET Framework have any methods for converting a path (e.g. "C:\whatever.txt") into a file URI (e.g. "file:///C:/whatever.txt")? The System.Uri class has the reverse (from a file URI to absolute path), but nothing as far as I can find for converting to a file URI. Also, this is not an ...

3
голосов
3ответов
4622 просмотров

How to specify rubygems path in environment-less Ruby script?

I've written a data collection script for Cacti in Ruby and it runs fine from the command line but Cacti runs the script via "env -i" which strips the environment so Ruby can't find the rubygems library ("in `require': no such file to load -- rubygems (LoadError)"). How might I work around this?

18
голосов
2ответов
3576 просмотров

Is there a version of os.getcwd() that doesn't dereference symlinks?

Possible Duplicate: How to get/set logical directory path in python I have a Python script that I run from a symlinked directory, and I call os.getcwd() in it, expecting to get the symlinked path I ran it from. Instead it gives me the "real" path, and in this case that's not helpful. I...

1
голосов
2ответов
1510 просмотров

How to properly make path handling robust in a bash program?

The script have some hard-coded relative paths. I would like them to be relative to script position. The script needs to change current directory as some other program (cmake) needs it. The script takes some (possibly relative to caller) paths as an argument and it passes them to that program, t...

7
голосов
1ответов
6877 просмотров

Getting a file path from a file handle in Windows

In Windows, is there a straightforward way to get the full path of a file, given only the file's handle? I can't use GetFinalPathNameByHandle() because that's Vista+ only and our product has to work on XP. However, something that simple, or close to it, would be best.

19
голосов
2ответов
2937 просмотров

Why Path.Combine doesn't add the Path.DirectorySeparatorChar after the drive designator?

var actual = Path.Combine("c:", "filename"); var expected = @"c:\filename"; Assert.AreEqual(expected, actual); Result {Assert.AreEqual failed. Expected:<c:\filename>. Actual:<c:filename>. Why?

1
голосов
1ответов
317 просмотров

eclipse and path

Hello I have written a such function under Eclipse: public static ArrayList<String> getMails(){ ArrayList<String> mails = new ArrayList<String>(); try{ FileInputStream fstream = new FileInputStream("mails.txt"); DataInputStream in = new DataI...

3
голосов
2ответов
4614 просмотров

Python module search path problem

I am trying to work on a dev environment but am find problems in that python seems to be using modules from the site-packages directory. I want it to be using the modules from my dev directory. sys.path returns a bunch of dirs, like this ['', '/usr/lib/python26.zip', '/usr/lib/python2.6', '/usr...

3
голосов
1ответов
5834 просмотров

Django ImageField / FileField custom upload_to function, and security

I have part of a model defined like this: logo_image = models.ImageField(upload_to=lambda i, fn: "logo_%s"%(fn), height_field="logo_image_height", width_field="logo_image_width") and had a question about the upload_to function. According to django's documentation for FileField.upload_to, the ...

10
голосов
4ответов
24461 просмотров

PHP way to find the web server's temp path?

When you handle an HTTP upload the file is uploaded to $_FILES['field_name']['tmp_name'] I know I could extract the temp path from there. But I was expecting maybe a $_SERVER param that had the temp path (there's none) or other elegant way of knowing it. Is there any?

6
голосов
3ответов
18035 просмотров

How to permanently change sudo's $PATH variable (Ubuntu 9.x)

I want add some directory to the $PATH when running sudo, this is a (semi) permanent requirement, not something that needs to be added to the scripts themselves. I notice that Django has managed to do it, (my $PATH when running sudo is "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin...

1
голосов
2ответов
285 просмотров

Problem with echo $PATH

I am working on bash shell When I type echo $PATH on $ prompt I get the value of path environment variable as /opt/bin:/usr/local/bin:/usr/bin:/bin:/usr/games I am creating my own shell and I want to print the path environment variable when user enters echo $PATH. How do I do that?

0
голосов
2ответов
657 просмотров

Overlaying 2D paths on UIImage without scaling artifacts

I need to draw a path along the shape of an image in a way that it is always matching its position on the image independent of the image scale. Think of this like the hybrid view of Google Maps where streets names and roads are superimposed on top of the aerial pictures. Furthermore, this path w...

40
голосов
3ответов
63241 просмотров

What does __FILE__ mean?

I have the following code from Codeigniter index.php My understanding is that, If / of string position in $system_folder (in this case CIcore_1_7_1) is false, and if realpath function exists AND (?) is not false, $system_folder is assigned to (?) /$system_folder. else $system_folder is assigned...

1
голосов
5ответов
1925 просмотров

Executing "echo $PATH" from a c program?

I am trying to display, set & modify PATH environment variable from a C program. I am doing something like this:- char *cmd[] = { "echo", "$PATH", (char *)0 }; if (execlp("echo", *cmd) == -1) But I am not getting the results.

1
голосов
2ответов
790 просмотров

How do I change the lookup path for .NET libraries referenced via #using in Managed C++?

I developed a DLL in Managed C++ which loads some plugins (implemented in any .NET language) at runtime using System.Reflection.Assembly.LoadFile. The interface which is implemented by all plugins is implemented in C#. It's used by the Managed C++ code like this: #using <IMyPluginInterface.dl...

9
голосов
4ответов
29728 просмотров

iPhone : Get the file path which is within subfolder of Resource folder

I am new to iPhone programming. I want to read the content of a text file located in a subfolder of the Resource folder. The Resource folder structure is the following: Resource Folder1---->Data.txt Folder2---->Data.txt Folder3---->Folder1---->Data.txt There are multiple files n...

3
голосов
3ответов
5278 просмотров

Difference between "Network path not found" and "Access denied" in C#

In my C# .NET 2.0 application I'm accessing network paths, and I'd like to be able to tell the difference between paths that don't exist, and paths which do exist but for which I don't have access rights. I tried doing the following: try { string[] contents = Directory.GetFileSystemEntries(...

2
голосов
5ответов
6235 просмотров

Why can't I invoke python from the command line?

I have Python 2.6 installed on Windows Vista. If I am at C:\Python26> and I type python, Python's command-line interface starts, as desired. I have added C:\Python26 to my PATH so that I would be able to run Python scripts from any directory, but it hasn't helped. In particular, from any ot...

5
голосов
3ответов
1433 просмотров

Path to current file depends on how I execute the program

This is my Python program: #!/usr/bin/env python import os BASE_PATH = os.path.dirname(__file__) print BASE_PATH If I run this using python myfile.py it prints an empty string. If I run it using myfile.py, it prints the correct path. Why is this? I'm using Windows Vista and Python 2.6.2.

2
голосов
4ответов
6752 просмотров

iPhone xcode search path for device vs simulator?

I am confused at this setting (Project -> Edit Active Target). The Search Paths can differ based on the SDK setting (simulator vs device). But if I provide both simulator and device paths, for lets say the Frameworks path, then i get linker errors. But it seems if I only provide the proper pa...

3
голосов
2ответов
1139 просмотров

Path Simplification/Reduction

I'm writing some code to manage a custom on disk file structure and syncronize it to unconnected systems. One of my requirements is to be able to estimate the size of a sync prior to actually generating the sync content. As a simple solution, I've put together a map with full path filenames as ...

2
голосов
2ответов
4884 просмотров

Get Caller Absolute Path - Bash Mac OS X Leopard

I am running a jar file from within an app bundle on Mac OS X Leopard. I need to pass into the jar a parameter. The parameter is the absolute path of the file which called the app bundle. I have my short bash script below. I know $0 gives the absolute path to the app bundle itself. Does anyone ...

4
голосов
3ответов
1680 просмотров

in android sdk1.5 where do i find my Sqlite Db in my system

I am creating an Android application and in that application I created one DB. I'm querying the values in the DB and its working fine. I need to know where the SQLite DB is stored in my system. Can you give me the path, please? Thank you!

2
голосов
3ответов
2026 просмотров

How to obtain the relative root path of application being developed in C#.NET MVC?

I have a few unit tests that require files from the project to be used to run the unit tests. These files are just images. I need to get the image file using some kind of function within c#, other than pasting the full path like below. string filePath = @"C:\Users\user1\Documents\Visual Studio...

3
голосов
5ответов
951 просмотров

Python: How to find presence of every list item in string

What is the most pythonic way to find presence of every directory name ['spam', 'eggs'] in path e.g. "/home/user/spam/eggs" Usage example (doesn't work but explains my case): dirs = ['spam', 'eggs'] path = "/home/user/spam/eggs" if path.find(dirs): print "All dirs are present in the path" ...

0
голосов
1ответов
147 просмотров

Custom library files and web application on shared hosting?

Let me put my issue defining a real scenario: I am using dedicated server where PHP and MySQL are available. My PHP include_path=/var/local/php I am developing a custom cms application, where I am writing my own library which is responsible for communicating with the database and retrieving da...