import os
import mimetypes
# FIXME these are mostly stubs, no more

def get_mimetype(filename):
	if os.path.isdir(filename): return "inode/directory"
	else:
		tupl = mimetypes.guess_type(filename)
		mimetype = tupl[0]
		if mimetype is None: return "application/octet-stream"
		return mimetype