parameters: (path)
docstring: Return path/drive free space (in bytes).
docstring_summary: Return path/drive free space (in bytes).
docstring_tokens: Return path / drive free space ( in bytes ) .
function: def CheckFreeSpace(path):
    """Return path/drive free space (in bytes)."""
    if IS_WINDOWS:
      try:
        # pylint: disable=invalid-name
        get_disk_free_space_ex = WINFUNCTYPE(c_int, c_wchar_p,
                                             POINTER(c_uint64),
                                             POINTER(c_uint64),
                                             POINTER(c_uint64))
        get_disk_free_space_ex = get_disk_free_space_ex(
            ('GetDiskFreeSpaceExW', windll.kernel32), (
                (1, 'lpszPathName'),
                (2, 'lpFreeUserSpace'),
                (2, 'lpTotalSpace'),
                (2, 'lpFreeSpace'),))
      except AttributeError:
        get_disk_free_space_ex = WINFUNCTYPE(c_int, c_char_p,
                                             POINTER(c_uint64),
                                             POINTER(c_uint64),
                                             POINTER(c_uint64))
        get_disk_free_space_ex = get_disk_free_space_ex(
            ('GetDiskFreeSpaceExA', windll.kernel32), (
                (1, 'lpszPathName'),
                (2, 'lpFreeUserSpace'),
                (2, 'lpTotalSpace'),
                (2, 'lpFreeSpace'),))
  
      def GetDiskFreeSpaceExErrCheck(result, unused_func, args):
        if not result:
          raise WinError()
        return args[1].value
      get_disk_free_space_ex.errcheck = GetDiskFreeSpaceExErrCheck
  
      return get_disk_free_space_ex(os.getenv('SystemDrive'))
    else:
      (_, f_frsize, _, _, f_bavail, _, _, _, _, _) = os.statvfs(path)
      return f_frsize * f_bavail
function_tokens: def CheckFreeSpace ( path ) : if IS_WINDOWS : try : # pylint: disable=invalid-name get_disk_free_space_ex = WINFUNCTYPE ( c_int , c_wchar_p , POINTER ( c_uint64 ) , POINTER ( c_uint64 ) , POINTER ( c_uint64 ) ) get_disk_free_space_ex = get_disk_free_space_ex ( ( 'GetDiskFreeSpaceExW' , windll . kernel32 ) , ( ( 1 , 'lpszPathName' ) , ( 2 , 'lpFreeUserSpace' ) , ( 2 , 'lpTotalSpace' ) , ( 2 , 'lpFreeSpace' ) , ) ) except AttributeError : get_disk_free_space_ex = WINFUNCTYPE ( c_int , c_char_p , POINTER ( c_uint64 ) , POINTER ( c_uint64 ) , POINTER ( c_uint64 ) ) get_disk_free_space_ex = get_disk_free_space_ex ( ( 'GetDiskFreeSpaceExA' , windll . kernel32 ) , ( ( 1 , 'lpszPathName' ) , ( 2 , 'lpFreeUserSpace' ) , ( 2 , 'lpTotalSpace' ) , ( 2 , 'lpFreeSpace' ) , ) ) def GetDiskFreeSpaceExErrCheck ( result , unused_func , args ) : if not result : raise WinError ( ) return args [ 1 ] . value get_disk_free_space_ex . errcheck = GetDiskFreeSpaceExErrCheck return get_disk_free_space_ex ( os . getenv ( 'SystemDrive' ) ) else : ( _ , f_frsize , _ , _ , f_bavail , _ , _ , _ , _ , _ ) = os . statvfs ( path ) return f_frsize * f_bavail