Tag Archive: code snippet

Jun
12
2012

How to Delete Directories Recursively with Win32

Well, while I’m at it, here’s the counterpart to the recursive directory creation function from my last post, a function that recursively deletes a directory and all its contents. Ordinarily, you could just use the shell API to achieve this on classic Win32: /// <summary>Deletes a directory and everything in it</summary> /// <param name=”path”>Path of …

Continue reading »

Jun
12
2012

How to Create Directories Recursively with Win32

As I just found out, the CreateDirectory function on Win32 can only create one directory at a time. If one, for example, specifies C:\Users\All Users\FirstNew\SecondNew as the directory to create, and both FirstNew and SecondNew do not exist, then CreateDirectory() fails. That’s less than ideal for some cases. Recently, for example, I wanted my game …

Continue reading »

Social Widgets powered by AB-WebLog.com.