path

Including files by relative path

試著忘記壹切 提交于 2019-12-18 09:23:22
问题 There must be something i don't understand about linking files -- but here's my problem. Basically, i have three files. generalfunctions.php wordcount.php index.php All three files are in different directories. B relies on A as follows: ../../../phpfunctions/generalfucntions.php And when I run B all is well. But C relies on B as follows: ../wordcount.php When I run C, I get an error saying that linked file A cannot be found. The actual error is: No such file or directory in /.../public_html

Storing a file in the user's directory in cross-platform Java

a 夏天 提交于 2019-12-18 08:51:46
问题 I have a Java application that runs on Mac and Windows, directly off a CD/DVD with no installation. Now, I need to store a file containing per-user data (think favourites etc.) somewhere on the local file system, so that it can be written to. So, where do you think is a good location for this file? I am thinking something like: <USER_DOCUMENTS_AND_SETTINGS>/application data/myapp/favourites.db for windows <USER_HOME_DIR>/.myapp/favourites.db for mac/nix Thoughts? And does anyone know the best

Storing a file in the user's directory in cross-platform Java

三世轮回 提交于 2019-12-18 08:51:43
问题 I have a Java application that runs on Mac and Windows, directly off a CD/DVD with no installation. Now, I need to store a file containing per-user data (think favourites etc.) somewhere on the local file system, so that it can be written to. So, where do you think is a good location for this file? I am thinking something like: <USER_DOCUMENTS_AND_SETTINGS>/application data/myapp/favourites.db for windows <USER_HOME_DIR>/.myapp/favourites.db for mac/nix Thoughts? And does anyone know the best

Java FileOutputStream: path relative to program folder?

a 夏天 提交于 2019-12-18 08:49:20
问题 What is the best way to find a path relative to the folder where a java application is "installed"? I have a class with a static method: public static void saveToFile(String fileName) When I call it with an absolute path, it works, but what I really want is the relative path to where the application is run from, and a folder. I have not deployed my application, but right now I want to find a path relative to the (Netbeans) project root, and a folder within called data: ProjectName\data\file

Installed python3, getting command not found error in terminal

若如初见. 提交于 2019-12-18 07:40:22
问题 I installed python3, I can open idle and it says it is running python3.0.1, but when I enter python3 in the terminal (on OSX) I get an error saying 'command not found'. Entering python gets me the 2.x version that came on the computer. Any advice on how I can access python3 from the terminal? Thanks 回答1: First, don't use Python 3.0.1. It has many problems and was officially retired upon the release of Python 3.1 (currently 3.1.2). You can find the python.org Mac OS X installer for 3.1.2 here.

How can I set/update PATH variable from within java application on Windows?

一曲冷凌霜 提交于 2019-12-18 07:23:13
问题 Something equivalent to this command line: set PATH=%PATH%;C:\Something\bin To run my application, some thing has to be in a PATH variable. So I want at the program beginning catch exceptions if program fails to start and display some wizard for user to select the installation folder of a program that needs to be in a PATH. The I would took that folder's absolute path and add it to the PATH variable and start my application again. EDIT : That "something" is VLC player. I need it's

Taking time to load the image from URL to UIImageview

半腔热情 提交于 2019-12-18 07:15:24
问题 I am using this code for displaying the image from URL to UIImageview UIImageView *myview=[[UIImageView alloc]init]; myview.frame = CGRectMake(50, 50, 320, 480); NSURL *imgURL=[[NSURL alloc]initWithString:@"http://soccerlens.com/files/2011/03/chelsea-1112-home.png"]; NSData *imgdata=[[NSData alloc]initWithContentsOfURL:imgURL]; UIImage *image=[[UIImage alloc]initWithData:imgdata]; myview.image=image; [self.view addSubview:myview]; But the problem is that its taking too long time to display

Search file with wildcard path

假装没事ソ 提交于 2019-12-18 07:06:49
问题 I want to write a script to prompt user for file path and list all files found. The file path can contain wildcards. Something similar to this. But the batch script version of it. For example: C:\Somewhere\user*\app\version-*.*\start.exe The files might be located like this: C:\Somewhere\user345\app\version-1.0\start.exe C:\Somewhere\user898\app\version-1.2\start.exe C:\Somewhere\user898\app\version-1.3\start.exe I tried to use FOR and it turns out to be so much harder than expected because

SPSS syntax - use path of the file

Deadly 提交于 2019-12-18 07:00:09
问题 I have a bunch of SPSS data and syntax files which I am moving around, changing folders on a daily basis. However, the relative paths remains the same. Is there a way to make use of this fact? e.g.: use the INCLUDE command and reference a syntax file which is always one path level up; or use GET to open a file, located two levels UP Googling around I found some reference to the HOST command, but I did not quite make it to work. Any input would be appreciated :) Thanks a lot in advance 回答1:

How to find relative path given two absolute paths?

放肆的年华 提交于 2019-12-18 06:12:14
问题 Given two absolute paths, e.g. /a/path/to/a /a/path/to/somewhere/else How can I get a relative path from one to the other, ../a ? In a sense, the opposite of what realpath does. 回答1: I answered a similar question here: Resolving a relative path without referencing the current directory on Windows. There is no standard function for this. There is a function in vi-like-emacs for this purpose. A quick check of apropos relative shows me few other programs which likely implement this: revpath for