Setting PATH environment variable in OSX permanently

I have read several answers on how to set environmental variables on OSX as permanently. First, I tried this, How to permanently set $PATH on Linux/Unix? but I had an error message saying no such file and directory, so I thought I could try ~/.bash_profile instead of ~/.profile but it did not work. Second, I … Read more

Access to the path is denied

I’m trying to save an image to a folder in .NET C# but I get this exception: Access to the path ‘C:\inetpub\wwwroot\mysite\images\savehere’ is denied.The error occured at mscorlib because at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, … Read more

C# Sanitize File Name

I recently have been moving a bunch of MP3s from various locations into a repository. I had been constructing the new file names using the ID3 tags (thanks, TagLib-Sharp!), and I noticed that I was getting a System.NotSupportedException: “The given path’s format is not supported.” This was generated by either File.Copy() or Directory.CreateDirectory(). It didn’t … Read more

How to refer to relative paths of resources when working with a code repository

We are working with a code repository which is deployed to both Windows and Linux – sometimes in different directories. How should one of the modules inside the project refer to one of the non-Python resources in the project (CSV files, etc.)? If we do something like: thefile = open(‘test.csv’) or: thefile = open(‘../somedirectory/test.csv’) It … Read more

Get real path from URI, Android KitKat new storage access framework [duplicate]

This question already has answers here: Android Gallery on Android 4.4 (KitKat) returns different URI for Intent.ACTION_GET_CONTENT (20 answers) Closed 7 years ago. Before the new gallery access in Android 4.4 (KitKat) I got my real path on the SD card with this method: public String getPath(Uri uri) { String[] projection = { MediaStore.Images.Media.DATA }; … Read more