def fsbsize(path):
 path = encode(path)
 if (os.name == 'nt'):
  import ctypes
  drive = ('%s\\' % os.path.splitdrive(path)[0])
  (cluster_sectors, sector_size) = ctypes.c_longlong(0)
  ctypes.windll.kernel32.GetDiskFreeSpaceW(ctypes.c_wchar_p(drive), ctypes.pointer(cluster_sectors), ctypes.pointer(sector_size), None, None)
  return (cluster_sectors * sector_size)
 else:
  return os.statvfs(path).f_frsize

def fsbsize ( path ) : path = encode ( path ) if ( os . name == 'nt' ) : import ctypes drive = ( '%s\\' % os . path . splitdrive ( path ) [ 0 ] ) ( cluster_sectors , sector_size ) = ctypes . c_longlong ( 0 ) ctypes . windll . kernel32 . GetDiskFreeSpaceW ( ctypes . c_wchar_p ( drive ) , ctypes . pointer ( cluster_sectors ) , ctypes . pointer ( sector_size ) , None , None ) return ( cluster_sectors * sector_size ) else : return os . statvfs ( path ) . f_frsize
get optimal file system buffer size for i/o calls .