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 ASP.NET application. 7 Answers … Read more

xcrun: error: active developer path (“/Applications/Xcode.app/Contents/Developer”) does not exist

I’m having xcode issues when I try to use brew and git: xcrun: error: active developer path (“/Applications/Xcode.app/Contents/Developer”) does not exist, use xcode-select –switch path/to/Xcode.app to specify the Xcode that you wish to use for command line developer tools (or see man xcode-select) I can type xcode-select and it shows that the command exists. When … Read more

How to place the ~/.composer/vendor/bin directory in your PATH?

I’m on Ubuntu 14.04 and I’ve been trying all possible methods to install Laravel to no avail. Error messages everything I try. I’m now trying the first method in the quickstart documentation, that is, via Laravel Installer, but it says to “Make sure to place the ~/.composer/vendor/bin directory in your PATH so the Laravel executable … Read more

Create whole path automatically when writing to a new file

I want to write a new file with the FileWriter. I use it like this: FileWriter newJsp = new FileWriter(“C:\\user\Desktop\dir1\dir2\filename.txt”); Now dir1 and dir2 currently don’t exist. I want Java to create them automatically if they aren’t already there. Actually Java should set up the whole file path if not already existing. How can I … Read more

What is the naming standard for path components?

I keep getting myself in knots when I am manipulating paths and file names because I don’t follow a naming standard for path components. Consider the following toy problem (Windows example, but hopefully the answer should be platform independent). You have been given the path of a folder: C:\users\OddThinking\Documents\My Source\ You want to walk the … Read more