Skip to content

Instantly share code, notes, and snippets.

@faultier
Created November 6, 2009 16:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save faultier/228067 to your computer and use it in GitHub Desktop.
Save faultier/228067 to your computer and use it in GitHub Desktop.
# 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