library/src/utility/BP-FileGeneralUtilities.cc
//! returns ERR_FAILURE or ERR_SUCCESS depending on if the file simply exists or not.
returns ERR_FAILURE or ERR_SUCCESS depending on if the file simply exists or not.
returns ERR_FAILURE or ERR_SUCCESS depending on if the file simply exists or not .
BP_ERROR_T BP_FileAtPathExists(char *file_path)
{
	if(!file_path)
		return ERR_FAILURE;
	if(!BP_StringIsReasonableForUnixEXT4Filename(file_path, bpstrlen(file_path), BP_FALSE))
		return ERR_FAILURE;
	if(access(file_path, F_OK) != -1)
	{
		return ERR_SUCCESS;
	}
	return ERR_FAILURE;
}
BP_ERROR_T BP_FileAtPathExists ( char * file_path ) { if ( ! file_path ) return ERR_FAILURE ; if ( ! BP_StringIsReasonableForUnixEXT4Filename ( file_path , bpstrlen ( file_path ) , BP_FALSE ) ) return ERR_FAILURE ; if ( access ( file_path , F_OK ) != -1 ) { return ERR_SUCCESS ; } return ERR_FAILURE ; }
returns ERR_FAILURE or ERR_SUCCESS depending on if the file simply exists or not.
returns ERR_FAILURE or ERR_SUCCESS depending on if the file simply exists or not .
// ensure we have a file pointer // ensure path is reasonable printable // attempt to access the file // return indicating failure