Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
# filetype=ruby fileencoding=utf8
framework 'MacFUSE'
class NamakeFS
STRING = '寒いので冬眠したい'
PATH = '/honne.txt'
def contentsOfDirectoryAtPath(path, error:error)
return [ PATH.lastPathComponent ]
end
def contentsAtPath(path)
if path == PATH
STRING.dataUsingEncoding(NSUTF8StringEncoding)
end
end
end
filesystem = GMUserFileSystem.alloc.initWithDelegate(NamakeFS.new, isThreadSafe:false)
filesystem.mountAtPath('/Volumes/NamakeFS', withOptions:['rdonly', 'volname=NamakeFS'])
NSRunLoop.currentRunLoop.run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment