Answers for "path for current directory"

0

get first directory in path environment variable

echo ${PATH%%:*}
Posted by: Guest on April-19-2020
0

Get directory path of file path

string filePath = @"C:MyDirMySubDirmyfile.ext";
string directoryName = Path.GetDirectoryName(filePath);
Console.WriteLine($"GetDirectoryName('{filePath}') returns '{directoryName}'");

//This code produce the following output:
GetDirectoryName('C:MyDirMySubDirmyfile.ext') returns 'C:MyDirMySubDir'
Posted by: Guest on September-17-2021

Code answers related to "path for current directory"

Browse Popular Code Answers by Language