Exemplo n.º 1
0
        public Result readdir(string path, IntPtr buf, fuse_fill_dir_t filler, ulong offset, ref fuse_file_info fi)
        {
            Logger.WriteLine("hello_readdir: '{0}', {1}", path, offset);
            Logger.Flush(); Stream.Flush();

            if (path != "/") return Result.ENOENT;

            //return Result.ENOENT;

            foreach (var String in new[] { ".", "..", "hello" })
            {
                //var Ptr = Marshal.StringToHGlobalAuto(String); filler(buf, Ptr, null, (IntPtr)0);
                var FillResult = filler(buf, String, null, 0);
                //Logger.WriteLine("  : '{0}' : {1}", String, FillResult);
            }

            return Result.OK;
        }
Exemplo n.º 2
0
        public int read(string path, byte* buf, IntPtr size, ulong offset, fuse_file_info* fi)
        {
            for (int n = 0; n < size.ToInt32(); n++) buf[n] = (byte)'a';

            return (int)size;
        }
Exemplo n.º 3
0
        public Result open(string path, ref fuse_file_info fi)
        {
            Logger.WriteLine("hello_open: '{0}'", path); Logger.Flush(); Stream.Flush();

            return Result.OK;
        }
Exemplo n.º 4
0
 public Result opendir(string path, fuse_file_info* fi)
 {
     Logger.WriteLine("hello_opendir: '{0}'", path);
     return Result.OK;
 }
Exemplo n.º 5
0
            public Result readdir(string path, IntPtr buf, fuse_fill_dir_t filler, ulong offset, ref fuse_file_info fi)
            {
                Logger.WriteLine("readdir: '{0}'", path);
                int Count = 0;

                foreach (var Entry in Tree.GetFilesInFolder(new EntryPath(path)))
                {
                    if (Entry.name == null)
                    {
                        filler(buf, ".", null, 0);
                        //filler(buf, "..", null, 0);
                    }
                    else
                    {
                        filler(buf, Entry.name, null, 0);
                    }

                    Count++;
                }

                return (Count == 0) ? Result.ENOENT : Result.OK;
            }