(filename)
Checks for file existence and readability
Checks for file existence and readability
Checks for file existence and readability
def checkFile(filename):
    """
    Checks for file existence and readability
    """

    valid = True

    if filename is None or not os.path.isfile(filename):
        valid = False

    if valid:
        try:
            with open(filename, "rb"):
                pass
        except:
            valid = False

    if not valid:
        raise SqlmapSystemException("unable to read file '%s'" % filename)
def checkFile ( filename ) : valid = True if filename is None or not os . path . isfile ( filename ) : valid = False if valid : try : with open ( filename , "rb" ) : pass except : valid = False if not valid : raise SqlmapSystemException ( "unable to read file '%s'" % filename )