Example #1
0
 protected static string getFilenameInternal(FileSystemInfo info)
 {
     return (info != null) ? Path.GetFileName(info.ToString()) : string.Empty;   // we need original path, including "." and ".."
 }
Example #2
0
        //public int getATime ( void )
        //public string getBasename ([ string $suffix ] )
        //public int getCTime ( void )
        //public string getExtension ( void )
        //public SplFileInfo getFileInfo ([ string $class_name ] )

        protected static string getPathnameInternal(FileSystemInfo info)
        {
            if (info == null)
                return string.Empty;

            // handle . and ..
            var originalPath = info.ToString();
            if (originalPath.EndsWith("."))
            {
                string fname = Path.GetFileName(originalPath);
                if (fname == "." || fname == "..")
                    return originalPath;
            }

            // otherwise use FullName
            return info.FullName;
        }