filepath

Two asterisks in file path

南笙酒味 提交于 2019-11-27 00:16:14
问题 What does the following file path mean? $(Services_Jobs_Drop_Path)\**\*.config The variable just holds some path, nothing interesting. I'm a lot more concerned, what the hell the ** mean. Any ideas? P.S. The following path is used in msbuild scripts, if it helps. 回答1: \**\ This pattern is often used in Copy Task for recursive folder tree traversal. Basically it means that all files with extension config would be processed from the all subdirectories of $(Services_Jobs_Drop_Path) path. MSDN,

Getting current directory in .NET web application

穿精又带淫゛_ 提交于 2019-11-27 00:07:17
So I have a web project, and I'm trying to get the root directory of the website using the c# method Directory.GetCurrentDirectory() . I don't want to be using a static path as the file locations will be changing in the future. This method is running in my imageProcess.aspx.cs file, but where I thought it would return: C:\Users\tcbl\documents\visual studio 2010\Projects\ModelMonitoring\ModelMonitoring\imageProcess.aspx.cs I'm instead getting: C:\Program Files\Common Files\Microsoft Shared\DevServer\10.0\ Can anyone explain why this is happening and what a possible solution might be? Thanks a

File path issues in R using Windows (“Hex digits in character string” error)

主宰稳场 提交于 2019-11-26 23:41:10
I run R on Windows, and have a csv file on the Desktop. I load it as follows, x<-read.csv("C:\Users\surfcat\Desktop\2006_dissimilarity.csv",header=TRUE) but the R gives the following error message Error: '\U' used without hex digits in character string starting "C:\U" So what's the correct way to load this file. I am using Vista replace all the \ with \\ . it's trying to escape the next character in this case the U so to insert a \ you need to insert an escaped \ which is \\ Please do not mark this response as correct as smitec has already answered correctly. I'm including a convenience

How to escape the backslashes and the automatically generated escape character in file path in java

家住魔仙堡 提交于 2019-11-26 22:54:56
I have very small and simple problem but I am not getting solutions on it. Actually I am getting a CSV file path using file chooser. I am entering the data in this csv file in to database using load data local infile query. Suppose my entered file path is "C:\title.csv" When I put this string in to query the you will see the \t combination in the path. This \t which is actually part of the file path and not the escape character '\t'. But the java and mysql consider it as escape character. then I tried to replace '\' in the file path string with "\\" using following code line. String filepath=

Get filepath and filename of selected gallery image in Android

会有一股神秘感。 提交于 2019-11-26 20:26:29
I am creating an app which uploads a selected image from the gallery and uploads it to a web service. The webservice requires the filename of selected image plus a base64 encoding of the file contents. I have managed to achieve this with a hardcoded file path. However, I am struggling to get the real filepath of the image. I have read around the web and have this code, but it does not work for me: public void onActivityResult(int requestCode, int resultCode, Intent data) { if (resultCode == RESULT_OK) { Uri selectedImageUri = data.getData(); String[] projection = {MediaStore.Images.Media.DATA}

How can I open files relative to my GOPATH?

孤街醉人 提交于 2019-11-26 20:04:48
问题 I'm using io/ioutil to read a small text file: fileBytes, err := ioutil.ReadFile("/absolute/path/to/file.txt") And that works fine, but this isn't exactly portable. In my case, the files I want to open are in my GOPATH, for example: /Users/matt/Dev/go/src/github.com/mholt/mypackage/data/file.txt Since the data folder rides right alongside the source code, I'd love to just specify the relative path: data/file.txt But then I get this error: panic: open data/file.txt: no such file or directory

How do I get the file name from a String containing the Absolute file path?

自古美人都是妖i 提交于 2019-11-26 19:34:49
String variable contains a file name, C:\Hello\AnotherFolder\The File Name.PDF . How do I only get the file name The File Name.PDF as a String? I planned to split the string, but that is not the optimal solution. just use File.getName() File f = new File("C:\\Hello\\AnotherFolder\\The File Name.PDF"); System.out.println(f.getName()); using String methods : File f = new File("C:\\Hello\\AnotherFolder\\The File Name.PDF"); System.out.println(f.getAbsolutePath().substring(f.getAbsolutePath().lastIndexOf("\\")+1)); Alternative using Path (Java 7+): Path p = Paths.get("C:\\Hello\\AnotherFolder\\The

Changing MongoDB data store directory

强颜欢笑 提交于 2019-11-26 19:19:05
Until now I have not been specifying a MongoDB data directory and have had only one 30 GB primary partition. I just ran out of space and added a new hard disk. How can I transfer my data (that is apparently in /var/lib/mongodb/ ) and configure MongoDB so that everything runs off of the new disk without affecting my existing installation? Brendan W. McAdams The short answer is that the --dbpath parameter in MongoDB will allow you to control what directory MongoDB reads and writes it's data from. mongod --dbpath /usr/local/mongodb-data Would start mongodb and put the files in /usr/local/mongodb

UTF8 Filenames in PHP and Different Unicode Encodings

99封情书 提交于 2019-11-26 17:26:15
问题 I have a file containing Unicode characters on a server running linux. If I SSH into the server and use tab-completion to navigate to the file/folder containing unicode characters I have no problem accessing the file/folder. The problem arises when I try accessing the file via PHP (the function I was accessing the file system from was stat ). If I output the path generated by the PHP script to the browser and paste it into the terminal the file also seems to exist (even though looking at the

Getting filesystem path of class being executed [duplicate]

送分小仙女□ 提交于 2019-11-26 17:23:35
This question already has an answer here: Find where java class is loaded from 10 answers Is there any way to determine current filesystem location of executed class from the code of this class, in runtime, given that it's executed using java command? For example for following class: public class MyClass{ public static void main(String[] args){\ new MyClass().doStuff(); } private void doStufF(){ String path = ... // what to do here?! System.out.println("Path of class being invoked: " + path); } } Is there any way to get and print the correct path in filesystem of MyClass.class file just being