filepath

Node npm windows file paths are too long to install packages

狂风中的少年 提交于 2019-11-26 10:16:31
问题 Situation I want to use gulp and related front-end tool chains in Windows-hosted development environments. I\'m hitting a wall trying to use gulp plug-ins like Browser-Sync, because the node_modules folder graph fans out making the windows file paths too long to copy the files. I\'d like a pragmatic approach for handling this problem right now on Windows, irrespective of what the Node community may or may not provide to improve npm usability on the Windows in the future. 2 Questions Is there

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

北战南征 提交于 2019-11-26 10:09:33
问题 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 回答1: 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 \\

How can one get an absolute or normalized file path in .NET?

你。 提交于 2019-11-26 09:55:44
问题 How can one with minimal effort (using some already existing facility, if possible) convert paths like c:\\aaa\\bbb\\..\\ccc to c:\\aaa\\ccc ? 回答1: Path.GetFullPath perhaps? 回答2: I would write it like this: public static string NormalizePath(string path) { return Path.GetFullPath(new Uri(path).LocalPath) .TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar) .ToUpperInvariant(); } This should handle few scenarios like uri and potential escaped characters in it, like file:///C:

Getting current directory in .NET web application

爷,独闯天下 提交于 2019-11-26 09:18:57
问题 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\

Difference between forward slash (/) and backslash (\) in file path

∥☆過路亽.° 提交于 2019-11-26 08:55:19
问题 I was wondering about the difference between \\ and / in file paths. I have noticed that sometimes a path contains / and sometimes it is with \\ . It would be great if anyone can explain when to use \\ and / . 回答1: / is the path separator on Unix and Unix-like systems. Modern Windows can generally use both \ and / interchangeably for filepaths, but Microsoft has advocated for the use of \ as the path separator for decades. This is done for historical reasons that date as far back as the 1970s

Changing MongoDB data store directory

荒凉一梦 提交于 2019-11-26 08:54:50
问题 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? 回答1: 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 -

Difference between ./ and ~/

Deadly 提交于 2019-11-26 08:35:55
问题 When creating filepaths and URLs, I noticed that many times the path starts with ./ or ~/ . What is the difference between filepaths that start with ./ and ~/ ? What do each of them mean? 回答1: ./ means "starting from the current directory". . refers to the current working directory, so something like ./foo.bar would be looking for a file called foo.bar in the current directory. (As a side note, .. means refers to the parent directory of the current directory. So ../foo.bar would be looking

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

为君一笑 提交于 2019-11-26 08:28:13
问题 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

Get filepath and filename of selected gallery image in Android

我是研究僧i 提交于 2019-11-26 07:35:11
问题 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 ==

Getting filesystem path of class being executed [duplicate]

天大地大妈咪最大 提交于 2019-11-26 05:25:30
问题 This question already has answers here : Find where java class is loaded from (10 answers) Closed last year . 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