Skip to content

Instantly share code, notes, and snippets.

@mafaca
Created August 15, 2018 18:00
Show Gist options
  • Save mafaca/8e2a638dc289dfe0aefd1dabe3d32772 to your computer and use it in GitHub Desktop.
Save mafaca/8e2a638dc289dfe0aefd1dabe3d32772 to your computer and use it in GitHub Desktop.
//string reallyLongDirectory = @"123\";
string reallyLongDirectory = @"Test\abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
reallyLongDirectory = reallyLongDirectory + @"\abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
reallyLongDirectory = reallyLongDirectory + @"\abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
Console.WriteLine($"Creating a directory that is {reallyLongDirectory.Length} characters long");
string absPath = Path.Combine(reallyLongDirectory, "123");
bool isExists = DirectoryUtils.Exists(absPath);
DirectoryUtils.CreateDirectory(absPath);
string fileName = string.Empty;
for(int i = 0; i < 245; i++)
{
fileName += 'a';
}
fileName += ".txt";
string filePath = Path.Combine(absPath, fileName);
isExists = FileUtils.Exists(filePath);
FileUtils.Create(filePath);
return;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment