Not sure if this is off-topic, but pd-l2ork has an external called patch_name (or patchname, can't remember off top my head) which gives you both the current open patch path and filename as two separate symbols. I am sure there might be other similar externals out there, I just failed to locate them...
Best wishes,
Ico