Wow, Perl turned 25 today, it seems my first use was like yesterday!
–jeroen
Posted by jpluimers on 2012/12/18
Wow, Perl turned 25 today, it seems my first use was like yesterday!
–jeroen
Posted in Development, Perl, Scripting, Software Development | Leave a Comment »
Posted by jpluimers on 2012/12/18
Ever since .NET 1 there has been no built-in way to create a file including all its parent directories.
Hence small FileHelper class far below.
The fundament of the class is this CreateUnderlyingDirectory
method, that uses System.IO.Path.GetDirectoryName to obtain the parent directory of a path, and then System.IO.Directory.CreateDirectory to create it (and any parent directories) if needed.
public static void CreateUnderlyingDirectory(string path) { string directoryPath = Path.GetDirectoryName(path); Directory.CreateDirectory(directoryPath); // NOP if it exists, will create all parent directories if not }
A few helper methods get you a StreamWriter either empty/appended, or always empty Read the rest of this entry »
Posted in .NET, .NET 3.5, .NET 4.5, C#, C# 2.0, C# 3.0, C# 4.0, C# 5.0, Development, Software Development | Leave a Comment »