def _syscmd_file(target, default=''):
 if (sys.platform in ('dos', 'win32', 'win16', 'os2')):
  return default
 target = _follow_symlinks(target)
 try:
  f = os.popen(('file "%s" 2> /dev/null' % target))
 except (AttributeError, os.error):
  return default
 output = string.strip(f.read())
 rc = f.close()
 if ((not output) or rc):
  return default
 else:
  return output

def _syscmd_file ( target , default = '' ) : if ( sys . platform in ( 'dos' , 'win32' , 'win16' , 'os2' ) ) : return default target = _follow_symlinks ( target ) try : f = os . popen ( ( 'file "%s" 2> /dev/null' % target ) ) except ( AttributeError , os . error ) : return default output = string . strip ( f . read ( ) ) rc = f . close ( ) if ( ( not output ) or rc ) : return default else : return output
interface to the systems file command .