# File lib/fuse/rfusefs-fuse.rb, line 159
      def getattr(ctx,path)

        return wrap_context(ctx,__method__,path) if ctx

        uid = Process.uid
        gid = Process.gid

        if  path == "/" || @root.directory?(path)
          #set "w" flag based on can_mkdir? || can_write? to path + "/._rfuse_check"
          write_test_path = (path == "/" ? "" : path) + CHECK_FILE

          mode = (@root.can_mkdir?(write_test_path) || @root.can_write?(write_test_path)) ? 0777 : 0555
          atime,mtime,ctime = @root.times(path)
          #nlink is set to 1 because apparently this makes find work.
          return RFuse::Stat.directory(mode,{ :uid => uid, :gid => gid, :nlink => 1, :atime => atime, :mtime => mtime, :ctime => ctime })
        elsif @created_files.has_key?(path)
          return @created_files[path]
        elsif @root.file?(path)
          #Set mode from can_write and executable
          mode = 0444
          mode |= 0222 if @root.can_write?(path)
          mode |= 0111 if @root.executable?(path)
          size = size(path)
          atime,mtime,ctime = @root.times(path)
          return RFuse::Stat.file(mode,{ :uid => uid, :gid => gid, :size => size, :atime => atime, :mtime => mtime, :ctime => ctime })
        else
          raise Errno::ENOENT.new(path)
        end

      end