Filename/path function for Wads struct

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

Moderator: GZDoom Developers

Filename/path function for Wads struct

Postby Varden Hupperwell » Thu Dec 09, 2021 6:22 pm

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.
Varden Hupperwell
 

Re: Filename/path function for Wads struct

Postby Caligari87 » Mon Dec 13, 2021 10:38 am

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-)
User avatar
Caligari87
User Accounts Assistant
 
Joined: 26 Feb 2004
Discord: Caligari87#3089
Github ID: caligari87

Re: Filename/path function for Wads struct

Postby Varden Hupperwell » Mon Dec 13, 2021 10:39 am

Ah. While disappointing, those are both excellent counterpoints.
Varden Hupperwell
 

Re: Filename/path function for Wads struct

Postby Graf Zahl » Mon Dec 13, 2021 11:17 am

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.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Filename/path function for Wads struct

Postby Varden Hupperwell » Mon Dec 13, 2021 11:47 am

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.
Varden Hupperwell
 


Return to Feature Suggestions

Who is online

Users browsing this forum: No registered users and 1 guest