Exemple #1
0
        public virtual int sceRtcSetTime64_t(TPointer dateAddr, long time)
        {
            ScePspDateTime dateTime = ScePspDateTime.fromUnixTime(time);

            dateTime.write(dateAddr);

            return(0);
        }
Exemple #2
0
        public override int ioGetstat(string fileName, SceIoStat stat)
        {
            File file = getFile(fileName);

            if (!file.exists())
            {
                return(SceKernelErrors.ERROR_ERRNO_FILE_NOT_FOUND);
            }

            // Set attr (dir/file) and copy into mode
            int attr = 0;

            if (file.Directory)
            {
                attr |= 0x10;
            }
            if (file.File)
            {
                attr |= 0x20;
            }

            int mode = (file.canRead() ? 4 : 0) + (file.canWrite() ? 2 : 0) + (file.canExecute() ? 1 : 0);

            // Octal extend into user and group
            mode  = mode + (mode << 3) + (mode << 6);
            mode |= attr << 8;

            // Java can't see file create/access time
            ScePspDateTime ctime = ScePspDateTime.fromUnixTime(file.lastModified());
            ScePspDateTime atime = ScePspDateTime.fromUnixTime(0);
            ScePspDateTime mtime = ScePspDateTime.fromUnixTime(file.lastModified());

            stat.init(mode, attr, file.Length(), ctime, atime, mtime);

            return(0);
        }