Exemplo n.º 1
0
        public override int ioDread(string dirName, SceIoDirent dir)
        {
            StringBuilder restFileName = new StringBuilder();
            string        umdFileName  = getUmdFileName(dirName, restFileName);

            if (!string.ReferenceEquals(umdFileName, null) && restFileName.Length == 0 && EBOOT_PBP.Equals(dir.filename))
            {
                int result = umdIoGetstat(umdFileName, restFileName.ToString(), dir.stat);
                if (result < 0)
                {
                    return(result);
                }

                return(1);
            }

            restFileName = new StringBuilder();
            umdFileName  = getUmdFileName(dir.filename, restFileName);
            if (!string.ReferenceEquals(umdFileName, null) && restFileName.Length == 0)
            {
                int result = umdIoGetstat(umdFileName, restFileName.ToString(), dir.stat);
                if (result < 0)
                {
                    return(result);
                }

                // Change attribute from "file" to "directory"
                dir.stat.attr = (dir.stat.attr & ~0x20) | 0x10;
                dir.stat.mode = (dir.stat.mode & ~0x2000) | 0x1000;

                return(1);
            }

            return(vfs.ioDread(dirName, dir));
        }
Exemplo n.º 2
0
        private void scan(string dirName, FatFileInfo parent)
        {
            string[] names = vfs.ioDopen(dirName);
            if (names == null || names.Length == 0)
            {
                return;
            }

            SceIoStat   stat = new SceIoStat();
            SceIoDirent dir  = new SceIoDirent(stat, null);

            for (int i = 0; i < names.Length; i++)
            {
                dir.filename = names[i];
                if (vfs.ioDread(dirName, dir) >= 0)
                {
                    bool        directory = (dir.stat.attr & 0x10) != 0;
                    bool        readOnly  = (dir.stat.mode & 0x2) == 0;
                    FatFileInfo fileInfo  = new FatFileInfo(vFile.DeviceName, dirName, dir.filename, directory, readOnly, dir.stat.mtime, dir.stat.size);

                    parent.addChild(fileInfo);

                    if (directory)
                    {
                        if (string.ReferenceEquals(dirName, null))
                        {
                            scan(dir.filename, fileInfo);
                        }
                        else
                        {
                            scan(dirName + "/" + dir.filename, fileInfo);
                        }
                    }

                    // Allocate the clusters after having scanned the children
                    allocateClusters(fileInfo);
                }
            }

            IList <FatFileInfo> children = parent.Children;

            if (children != null)
            {
                foreach (FatFileInfo child in children)
                {
                    computeFileName83(child, children);
                }
            }
        }
Exemplo n.º 3
0
 public virtual int ioDread(string dirName, SceIoDirent dir)
 {
     return(vfs.ioDread(dirName, dir));
 }