Skip to content

How to get the file path and file name from file metadata #7958

@emesare

Description

@emesare

I am writing a script, I want to know the file path (if available) and the file name. I understand that the file path is something that could be sensitive, and the BNDB may have removed it. What I want is to know, the two apis that I should be calling. Currently it seems we have four apis:

>>> bv.file.display_name
'/Users/emesare/Downloads/iterators.exe'
>>> bv.file.filename
'/Users/emesare/Downloads/iterators.exe'
>>> bv.file.original_filename
'/Users/emesare/Downloads/iterators.exe'
>>> bv.file.virtual_path
'/Users/emesare/Downloads/iterators.exe'

Its interesting to me that none of these apis are named to "get me the file path", a more straightforward approach would be to have a file_path and a file_name, I'm sure the "answer" will be that these are historical, but I'm more interested in what we are doing to simplify an API that really should not be that difficult to grok. All in all, these APIs seem extremely overloaded, and we should try and identify all usages of them in the product to determine what exactly each callers expectations are and refactor accordingly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Component: CoreIssue needs changes to the coreEffort: LowIssues require < 1 week of workImpact: LowIssue is a papercut or has a good, supported workaround

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions