parse filename or file