Exemplo n.º 1
0
        private unsafe int Readdir(path *path, void *buf, fuse_fill_dir *filler, ulong offset, fuse_file_info *fi, int flags)
        {
            try
            {
                fuse_fill_dir_Delegate fillDelegate;
                ManagedFiller          previousFiller = _previousFiller;
                if (previousFiller != null && previousFiller.Filler == filler)
                {
                    fillDelegate = previousFiller.Delegate;
                }
                else
                {
                    fillDelegate    = Marshal.GetDelegateForFunctionPointer <fuse_fill_dir_Delegate>(new IntPtr(filler));
                    _previousFiller = new ManagedFiller(filler, fillDelegate);
                }

                var fiF = new FuseFileInfo();
                return(_fileSystem.ReadDir(ToSpan(path), offset, (ReadDirFlags)flags, ToDirectoryContent(buf, fillDelegate), ref fiF));
            }
            catch (Exception ex)
            {
                Console.WriteLine($"READDIR gets error: {ex.Message}");
                return(-EIO);
            }
        }
Exemplo n.º 2
0
 private unsafe int Opendir(path *path, fuse_file_info *fi)
 {
     try
     {
         //Console.WriteLine("OPENDIR TOP - Fusemount");
         var fiF = new FuseFileInfo();
         return(_fileSystem.OpenDir(ToSpan(path), ref fiF));
         //return _fileSystem.OpenDir(ToSpan(path), ref ToFileInfoRef(fi));
     }
     catch (Exception ex)
     {
         Console.WriteLine($"OPENDIR gets error: {ex.Message}");
         return(-EIO);
     }
 }
 public virtual int Read(ReadOnlySpan <byte> path, ulong offset, Span <byte> buffer, ref FuseFileInfo fi)
 => - ENOSYS;
 public override int OpenDir(ReadOnlySpan <byte> path, ref FuseFileInfo fi)
 => OpenDir(ToString(path), ref fi);
 protected virtual int FSync(string path, bool onlyData, ref FuseFileInfo fi)
 => - ENOSYS;
 public override int Flush(ReadOnlySpan <byte> path, ref FuseFileInfo fi)
 => Flush(ToString(path), ref fi);
 public override int FAllocate(ReadOnlySpan <byte> path, int mode, ulong offset, long length, ref FuseFileInfo fi)
 => FAllocate(ToString(path), mode, offset, length, ref fi);
 public override int Create(ReadOnlySpan <byte> path, mode_t mode, ref FuseFileInfo fi)
 => Create(ToString(path), mode, ref fi);
 public override int Write(ReadOnlySpan <byte> path, ulong off, ReadOnlySpan <byte> span, ref FuseFileInfo fi)
 => Write(ToString(path), off, span, ref fi);
 public virtual int ReleaseDir(string path, ref FuseFileInfo fi)
 => - ENOSYS;
 public virtual void Release(string path, ref FuseFileInfo fi)
 {
 }
 public virtual int ReleaseDir(ReadOnlySpan <byte> path, ref FuseFileInfo fi)
 => - ENOSYS;
 public virtual void Release(ReadOnlySpan <byte> path, ref FuseFileInfo fi)
 {
 }
 public virtual int ReadDir(ReadOnlySpan <byte> path, ulong offset, ReadDirFlags flags, DirectoryContent content, ref FuseFileInfo fi)
 => - ENOSYS;
 protected virtual void Release(string path, ref FuseFileInfo fi)
 {
 }
 public virtual int Open(string path, ref FuseFileInfo fi)
 => - ENOSYS;
 protected virtual int ReleaseDir(string path, ref FuseFileInfo fi)
 => - ENOSYS;
 public virtual int OpenDir(string path, ref FuseFileInfo fi)
 => 0;
 protected virtual int Write(string path, ulong off, ReadOnlySpan <byte> span, ref FuseFileInfo fi)
 => - ENOSYS;
 public override int Read(ReadOnlySpan <byte> path, ulong offset, Span <byte> buffer, ref FuseFileInfo fi)
 => Read(ToString(path), offset, buffer, ref fi);
 protected virtual int Create(string path, mode_t mode, ref FuseFileInfo fi)
 => - ENOSYS;
 protected virtual int Read(string path, ulong offset, Span <byte> buffer, ref FuseFileInfo fi)
 => - ENOSYS;
 protected virtual int FAllocate(string path, int mode, ulong offset, long length, ref FuseFileInfo fi)
 => - ENOSYS;
 public override int ReadDir(ReadOnlySpan <byte> path, ulong offset, ReadDirFlags flags, DirectoryContent content, ref FuseFileInfo fi)
 => ReadDir(ToString(path), offset, flags, content, ref fi);
 public override int FSync(ReadOnlySpan <byte> path, bool onlyData, ref FuseFileInfo fi)
 => FSync(ToString(path), onlyData, ref fi);
 protected virtual int ReadDir(string path, ulong offset, ReadDirFlags flags, DirectoryContent content, ref FuseFileInfo fi)
 => - ENOSYS;
 protected virtual int Open(string path, ref FuseFileInfo fi)
 => - ENOSYS;
 public override void Release(ReadOnlySpan <byte> path, ref FuseFileInfo fi)
 => Release(ToString(path), ref fi);
 protected virtual int OpenDir(string path, ref FuseFileInfo fi)
 => 0;
 public virtual int OpenDir(ReadOnlySpan <byte> path, ref FuseFileInfo fi)
 => 0;