public override int Read(ReadOnlySpan <byte> path, ulong offset, Span <byte> buffer, ref FuseFileInfo fi, Guid fileGuid) { var context = FileContexts[fi.fh]; path = base.TransformPath(path); if (debug) { Console.WriteLine($"NeoFS::Read()"); } if (context.ExtAssetSha1 != null) // Asset Mode { return(base.AssetRead(path, offset, buffer, ref fi, fileGuid)); } if (fi.fh == 0) { var newFd = LibC.open(toBp(path), fi.flags); if (newFd > 0) { fi.fh = (ulong)newFd; } else { return(-LibC.errno); } } ssize_t res; fixed(void *vbuf = buffer) { res = LibC.pread((int)fi.fh, vbuf, buffer.Length, (long)offset); } if (res < 0) { return(-LibC.errno); } return((int)res); }