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

--overwrite doesn't overwrite broken symlinks #1406

Closed
dirn opened this issue Jan 2, 2025 · 1 comment · Fixed by #1466
Closed

--overwrite doesn't overwrite broken symlinks #1406

dirn opened this issue Jan 2, 2025 · 1 comment · Fixed by #1466
Assignees
Labels
bug A confirmed issues that needs fixing

Comments

@dirn
Copy link
Contributor

dirn commented Jan 2, 2025

Paste the command

igir link test --symlink --overwrite --dat=$DAT_PATH/ --input=$BACKUPS/OSCR/ --output=$HOME/ROMs/{es}/

Describe the bug

I had a few bad dumps that were symlinked into my ROMs folder without DAT verification. I deleted the source file, placing the symlinks in a broken state. I redumped the games, placing the new dumps in a different location than the originals. I ran the above command and received errors. The broken symlinks were left behind.

Expected behavior

I expected the broken symlinks to be removed and replaced with ones pointing to the files matched by igir.

Debug logs

[14:41:28.587] INFO:  CandidateWriter: Nintendo - Nintendo Entertainment System (Headered): Ninja Gaiden (USA): creating symlink '/Users/dirn/Backups/OSCR/nes/Ninja Gaiden (USA).nes' →
'/Users/dirn/ROMs/nes/Ninja Gaiden (USA).nes'
[14:41:28.588] ERROR: CandidateWriter: Nintendo - Nintendo Entertainment System (Headered): Ninja Gaiden (USA): /Users/dirn/ROMs/nes/Ninja Gaiden (USA).nes: failed to link from
/Users/dirn/Backups/OSCR/nes/Ninja Gaiden (USA).nes: EEXIST: file already exists, symlink '/Users/dirn/Backups/OSCR/nes/Ninja Gaiden (USA).nes' ->
'/Users/dirn/ROMs/nes/Ninja Gaiden (USA).nes'

DAT(s) used

No response

igir version

3.0.1

Node.js version

N/A

Operating system

macOS 15.2

Additional context

I only receive the errors for games that have broken symlinks. If I manually remove those, new ones are created. And subsequent runs don't error.

@dirn dirn added the potential-bug A potential issue that needs confirmation and/or triage label Jan 2, 2025
@emmercm emmercm added bug A confirmed issues that needs fixing and removed potential-bug A potential issue that needs confirmation and/or triage labels Mar 4, 2025
@emmercm emmercm self-assigned this Mar 4, 2025
@emmercm
Copy link
Owner

emmercm commented Mar 4, 2025

I found out what's happening. Igir doesn't think broken links exist on disk, so then there's "nothing" to delete before writing, resulting in an issue on write.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A confirmed issues that needs fixing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants