def validateFilepath(value, blank=False, strip=None, allowlistRegexes=None, blocklistRegexes=None, excMsg=None, mustExist=False):
returnNow, value = _prevalidationCheck(value, blank, strip, allowlistRegexes, blocklistRegexes, excMsg)<EOL>if returnNow:<EOL><INDENT>return value<EOL><DEDENT>if (value != value.strip()) or (any(c in value for c in '<STR_LIT>')): <EOL><INDENT>if '<STR_LIT::>' in value:<EOL><INDENT>if value.find('<STR_LIT::>', <NUM_LIT:2>) != -<NUM_LIT:1> or not value[<NUM_LIT:0>].isalpha():<EOL><INDENT>_raiseValidationException(_('<STR_LIT>') % (_errstr(value)), excMsg)<EOL><DEDENT><DEDENT>_raiseValidationException(_('<STR_LIT>') % (_errstr(value)), excMsg)<EOL><DEDENT>return value<EOL>raise NotImplementedError()<EOL>
r"""Raises ValidationException if value is not a valid filename.
    Filenames can't contain \\ / : * ? " < > |
    Returns the value argument.

    * value (str): The value being validated as an IP address.
    * blank (bool): If True, a blank string will be accepted. Defaults to False.
    * strip (bool, str, None): If None, whitespace is stripped from value. If a str, the characters in it are stripped from value. If False, nothing is stripped.
    * allowlistRegexes (Sequence, None): A sequence of regex str that will explicitly pass validation, even if they aren't numbers.
    * blocklistRegexes (Sequence, None): A sequence of regex str or (regex_str, response_str) tuples that, if matched, will explicitly fail validation.
    * excMsg (str): A custom message to use in the raised ValidationException.

    >>> import pysimplevalidate as pysv
    >>> pysv.validateFilepath('foo.txt')
    'foo.txt'
    >>> pysv.validateFilepath('/spam/foo.txt')
    '/spam/foo.txt'
    >>> pysv.validateFilepath(r'c:\spam\foo.txt')
    'c:\\spam\\foo.txt'
    >>> pysv.validateFilepath(r'c:\spam\???.txt')
    Traceback (most recent call last):
      ...
    pysimplevalidate.ValidationException: 'c:\\spam\\???.txt' is not a valid file path.