コード例 #1
0
ファイル: tempfs.cs プロジェクト: jhult/pfmkit
    int /*perr*/ FileFindOpenId(long openId, out File file)
    {
        int perr = Pfm.errorInvalid;

        file = null;
        OpenRef openRef = (OpenRef)(openRefs.Get(openId));

        if (openRef != null)
        {
            file = openRef.file;
            perr = 0;
        }
        return(perr);
    }
コード例 #2
0
ファイル: tempfs.cs プロジェクト: jhult/pfmkit
    void FileOpened(File file, ref Pfm.OpenAttribs openAttribs)
    {
        Debug.Assert(file.openId != 0);
        OpenRef openRef = (OpenRef)(openRefs.Get(file.openId));

        if (openRef == null)
        {
            openRef = new OpenRef(file);
            openRefs.Set(file.openId, openRef);
        }
        openRef.openSequence           = ++lastOpenSequence;
        openAttribs.openId             = file.openId;
        openAttribs.openSequence       = openRef.openSequence;
        openAttribs.accessLevel        = Pfm.accessLevelWriteData;
        openAttribs.attribs.fileType   = file.fileType;
        openAttribs.attribs.fileFlags  = file.fileFlags;
        openAttribs.attribs.fileId     = file.fileId;
        openAttribs.attribs.createTime = file.createTime;
        openAttribs.attribs.accessTime = file.accessTime;
        openAttribs.attribs.writeTime  = file.writeTime;
        openAttribs.attribs.changeTime = file.changeTime;
        openAttribs.attribs.fileSize   = file.fileSize;
    }