Decoupling the filenames in a pipeline

We wrote a code library for working with “resource files”. It’s written in C but exposed to Python so any of our tools can use it. A resource file is just a file in Perforce that has certain Perforce attributes on it. The code library leans on the local DB as much as possible for speed, getting attribute values from there. This also includes a couple values that aren’t metadata, strictly speaking, such as the full path to that file.

If a file has been moved it asks Perforce to locate it via a targeted “files” command. For single files this is usually less than 1/10th of a second. And that’s the slow way, DB lookups are much faster. If the file has been deleted, the library calls to get its info/metadata will fail (throwing an exception if it’s Python) and the tool then deals with the non-existent file in whatever way its author deems appropriate.