Package Tribler :: Package Core :: Module osutils

Module osutils

OS-independent utility functions
Functions
 
getfreespace(path)
 
fix_filebasename(name, unit=False, maxlen=255)
Check if str is a valid Windows file name (or unit name if unit is true)...
 
last_minute_filename_clean(name)
 
get_readable_torrent_name(infohash, raw_filename)
Variables
  test = win32file.GetDiskFreeSpaceEx(".")
  invalidwinfilenamechars = '\x00\x01\x02\x03\x04\x05\x06\x07\x0...
  invalidlinuxfilenamechars = '/'
  i = 31
Function Details

fix_filebasename(name, unit=False, maxlen=255)

 
Check if str is a valid Windows file name (or unit name if unit is true) * If the filename isn't valid: returns a corrected name * If the filename is valid: returns the filename

Variables Details

invalidwinfilenamechars

Value:
'''\x00\x01\x02\x03\x04\x05\x06\x07\x08\t
\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\
\x1d\x1e\x1f"*/:<>?\\|'''