Filename/path function for Wads struct

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is ON
[img] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Filename/path function for Wads struct

Re: Filename/path function for Wads struct

by Guest » 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.

Re: Filename/path function for Wads struct

by 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.

Re: Filename/path function for Wads struct

by Guest » Mon Dec 13, 2021 10:39 am

Ah. While disappointing, those are both excellent counterpoints.

Re: Filename/path function for Wads struct

by 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-)

Filename/path function for Wads struct

by Guest » 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.

Top