1
Vote

DirectoryInfo.Name wrong

description

DirectoryInfo.Name is returning the full path minus the directory name - rather than the directory name.
 
Here is the fixed code in ZlpPathHelper.cs:
    public static string GetDirectoryNameFromFilePath(string filePath)
    {
        var ls = filePath.LastIndexOf('\\');
 
        if (ls < 0)
        {
            return filePath;
        }
        else if (ls < filePath.Length-1)
        {
            return filePath.Substring(ls + 1);
        }
        else
        {   //ends with \ Remove and try again
            filePath = filePath.Substring(0, filePath.Length - 1);
            return GetDirectoryNameFromFilePath(filePath);
        }
    }

comments

bean wrote Jan 30, 2012 at 3:00 AM

:-( Still NOT fixed in 1.0.0.3

wrote Feb 14, 2013 at 1:38 AM