Skip to content

Instantly share code, notes, and snippets.

@DinisCruz
Created October 12, 2012 17:07
Show Gist options
  • Select an option

  • Save DinisCruz/3880284 to your computer and use it in GitHub Desktop.

Select an option

Save DinisCruz/3880284 to your computer and use it in GitHub Desktop.
C# Sample to try saving a file with a 0 char in the filename
var tempDir = "".tempDir();
var fileName = "__" + '\x43' + "__.txt"; // this will work
//var fileName = "__" + '\x43' + '\x00' + "__.txt"; // this will NOT work
var filePath = tempDir.pathCombine(fileName);
return "some text".saveAs(filePath);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment