static void mkdir(string path) { string name; string directory; name = path.Split('/').Last(); directory = path.Substring(0, path.Length - name.Length - 1); try { if (directory.Trim().Length == 0) { Console.WriteLine(nameServer.mkdir("/", name)); } else { Console.WriteLine(nameServer.mkdir(directory, name)); } } catch (Exception) { Console.WriteLine("Device temporarily unavailable. Try again later."); } }