Example #1
0
def open_numpy_mmap(ref):
    if not isinstance(ref, Reference):
        ref = get_reference(ref)
    fs = get_file_system(ref.scheme)
    if hasattr(fs, 'open_numpy_mmap'):
        return fs.open_numpy_mmap(ref)
    raise IOError('%s not supported for mmap access' % str(ref))
Example #2
0
def get_metadata(ref):
    if not isinstance(ref, Reference):
        ref = get_reference(ref)
    fs = get_file_system(ref.scheme)
    if hasattr(fs, 'get_metadata'):
        return fs.get_metadata(ref)
    return {
        'mimetype': fs.get_mimetype(ref),
        'description': '',
        'mtime': fs.get_mtime(ref),
        'size': fs.get_size(ref),
        }