Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WTEXport] Export fails if input files are read-only #46

Closed
biwa opened this issue Sep 11, 2021 · 3 comments
Closed

[WTEXport] Export fails if input files are read-only #46

biwa opened this issue Sep 11, 2021 · 3 comments
Labels
bug Introduced unintentional problem. dependent on 3rd party This issue requires a fix or change in a dependent library. high priority FIX IT.

Comments

@biwa
Copy link

biwa commented Sep 11, 2021

WTEXport fails to export if either the resources you want to export from, or the base (I)WAD is set to read-only.

For example my doom2.wad is set to read only, using it as a base results in the following error:

>wtexscan MAP01.wad | wtexport.cmd ..\..\wads\resource\OTEX_1.1.WAD --base-wad ..\..\iwads\doom2.wad --output mapstex.wad --create
Read texture/flat list...
Scanning ..\..\iwads\doom2.wad...
ERROR: "..\..\iwads\doom2.wad" could not be read.

When removing the read-only flag the export works as expeced.

This also happens when the resource to export from is set as read-only, although it bails out later:

>wtexscan MAP01.wad | wtexport.cmd ..\..\wads\resource\OTEX_1.1.WAD --base-wad ..\..\iwads\doom2.wad --output mapstex.wad --create
Read texture/flat list...
Scanning ..\..\iwads\doom2.wad...
    Scanning TEXTUREx/PNAMES...
        428 entries in TEXTURE1.
        469 entries in PNAMES.
    Scanning patch entries...
        475 patches.
    Scanning flat entries...
        153 flats.
    Scanning texture namespace entries...
        0 namespace textures.
Scanning ..\..\wads\resource\OTEX_1.1.WAD...
ERROR: "..\..\wads\resource\OTEX_1.1.WAD" could not be read.
@MTrop
Copy link
Owner

MTrop commented Sep 11, 2021

It might be because of the way that the main library (DoomStruct) opens WAD files for reading, since it opens them for random access in rws mode. The OS is probably attempting to acquire a write channel and failing (and rightfully so).

https://github.com/MTrop/DoomStruct/blob/9f8b6875159fc15bb655b927cc2ee0647f42b11e/src/main/java/net/mtrop/doom/WadFile.java#L94

A mode may need to be made for just forcing a read-only mode on WADs that I know won't be written to - a big oversight on my part! This means that a bunch of stuff in DoomTools may need tweaking afterward to accommodate.

@MTrop MTrop added bug Introduced unintentional problem. high priority FIX IT. dependent on 3rd party This issue requires a fix or change in a dependent library. labels Sep 11, 2021
@MTrop
Copy link
Owner

MTrop commented Sep 12, 2021

Heads up: I may not need to change much of anything due to how I'm implementing the fix in DoomStruct, but this issue is still going to kept open until the new version of DoomStruct that fixes this is added to the build.

@MTrop
Copy link
Owner

MTrop commented Sep 12, 2021

Fixed in commit e586cbb with the updating of DoomStruct to version 2.14.0.

@MTrop MTrop closed this as completed Sep 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Introduced unintentional problem. dependent on 3rd party This issue requires a fix or change in a dependent library. high priority FIX IT.
Projects
None yet
Development

No branches or pull requests

2 participants