Exemple #1
0
            internal ZfsSymLink(Zpl zpl, ZfsDirectory parent, string name, DNode dn, SaAttributes attr)
                : base(zpl, parent, name, dn, attr)
            {
                var bytes = attr.Get(zpl_attr_t.ZPL_SYMLINK);

                PointsTo = Encoding.ASCII.GetString(bytes.Array, bytes.Offset, bytes.Count);
            }
Exemple #2
0
            DateTime GetDateTime(SaAttributes attrs, zpl_attr_t attr)
            {
                var   bytes    = attrs.Get(attr);
                ulong seconds  = Program.ToStruct <ulong>(bytes.SubSegment(0, sizeof(ulong)));
                ulong nanosecs = Program.ToStruct <ulong>(bytes.SubSegment(sizeof(ulong), sizeof(ulong)));

                return(sEpoc.AddSeconds(seconds).AddTicks((long)(nanosecs / 100)));
            }
Exemple #3
0
            internal ZfsItem(Zpl zpl, ZfsDirectory parent, string name, DNode dn, SaAttributes attrs)
            {
                this.mZpl   = zpl;
                this.Name   = name;
                this.Parent = parent;
                this.mDn    = dn;
                if (mDn.Type != DmuType)
                {
                    throw new NotSupportedException();
                }

                mMode = attrs.Get <long>(zpl_attr_t.ZPL_MODE);

                CTIME = GetDateTime(attrs, zpl_attr_t.ZPL_CTIME);
                MTIME = GetDateTime(attrs, zpl_attr_t.ZPL_MTIME);
                ATIME = GetDateTime(attrs, zpl_attr_t.ZPL_ATIME);
            }
Exemple #4
0
 internal ZfsDirectory(Zpl zpl, ZfsDirectory parent, string name, DNode dn, SaAttributes attr)
     : base(zpl, parent, name, dn, attr)
 {
 }
Exemple #5
0
 internal ZfsDirectory(Zpl zpl, DNode dn, SaAttributes attr)
     : base(zpl, null, "/", dn, attr)
 {
     this.Parent = this;
 }
Exemple #6
0
 internal ZfsFile(Zpl zpl, ZfsDirectory parent, string name, DNode dn, SaAttributes attr)
     : base(zpl, parent, name, dn, attr)
 {
     Length = attr.Get <long>(zpl_attr_t.ZPL_SIZE);
 }
Exemple #7
0
        ZfsItemType GetFileType(SaAttributes attr)
        {
            var mode = attr.Get <long>(zpl_attr_t.ZPL_MODE);

            return((ZfsItemType)((mode >> 12) & 0xf));
        }