Ejemplo n.º 1
0
        public static (string Path, string Name, Result <Stat, FsException> Stat) ReadEntry(string dir, string name)
        {
            var full = Path.Join(Paths.Absolute(dir), name);

            if (Syscall.stat(full, out var stat) == 0)
            {
                if (stat.IsDir() && !full.EndsWith("/"))
                {
                    full += "/";
                }

                return(full, name, stat);
            }

            return(full, name, new FsException(full));
        }