Filename/path function for Wads struct

Remember, just because you request it, that doesn't mean you'll get it.

Moderator: GZDoom Developers

Guest

Filename/path function for Wads struct

Post by Guest »

Would it be possible to extend the Wads struct with a function that can read the filename or path of the wad/pk3/directory that a lump is in?
This could be useful for operating upon a specific lump depending on what wad it comes from, or even help segregate lumps of matching names between multiple wads.
User avatar
Caligari87
User Accounts Assistant
Posts: 6001
Joined: Thu Feb 26, 2004 3:02 pm
Preferred Pronouns: He/Him

Re: Filename/path function for Wads struct

Post by Caligari87 »

Getting the mod's filepath inside GZDoom is probably a big [No] for security reasons, as it can reveal details about the user's filesystem structure to a mod. Historically I've seen many requests denied on these grounds.

Getting the mod's filename inside GZDoom is a little more viable, but in my estimation probably still a [No] for practical reasons. Users rename their files all the time for various reasons, and it would be really bad if a mod broke because a user renamed the file The_Ivory_Tower.pk3 instead of IVRYTWR.pk3 (for example).

8-)
Guest

Re: Filename/path function for Wads struct

Post by Guest »

Ah. While disappointing, those are both excellent counterpoints.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 48598
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Filename/path function for Wads struct

Post by Graf Zahl »

The suggested use case is strongly discouraged because it runs the risk of breaking things as Caligari already stated. People indeed to frequently rename their things for various reasons so for content validation this is a huge no-no.

The only viable use case I can see is for implementing a directory browser.
Guest

Re: Filename/path function for Wads struct

Post by Guest »

I fully understand the arguments against the use case for the feature.

My hope had been to exclude certain (thousands of) lumps from a loop I run to check every lump that can end up performing costly checks (mainly 3saster's MD5), but I'm certainly in favor of a smarter way to do that, especially if checking wad/dir name is infeasible.

Return to “Feature Suggestions [GZDoom]”