Skip to content

mktemp: fix hidden file creation with dot prefix#12311

Open
gabrielhnf wants to merge 1 commit into
uutils:mainfrom
gabrielhnf:fix-mktemp-hidden-files
Open

mktemp: fix hidden file creation with dot prefix#12311
gabrielhnf wants to merge 1 commit into
uutils:mainfrom
gabrielhnf:fix-mktemp-hidden-files

Conversation

@gabrielhnf
Copy link
Copy Markdown

Fixes #12299

mktemp /tmp/.XXXXXXXX was failing with "Permission denied" because Path::file_name() treats a trailing . as the current directory, resolving it to the parent component name instead. This caused both the directory and prefix to be computed incorrectly.

Fixed by detecting when prefix_from_template ends in a lone . and extracting the directory and prefix directly from the raw string, before Path normalization can discard the dot.

@github-actions
Copy link
Copy Markdown

GNU testsuite comparison:

GNU test failed: tests/misc/tty-eof. tests/misc/tty-eof is passing on 'main'. Maybe you have to rebase?
Skip an intermittent issue tests/date/date-locale-hour (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/misc/io-errors (fails in this run but passes in the 'main' branch)

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 15, 2026

Merging this PR will improve performance by 13.71%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 2 improved benchmarks
✅ 315 untouched benchmarks
⏩ 46 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation ls_recursive_balanced_tree[(6, 4, 15)] 50.9 ms 48.9 ms +4.01%
Memory cp_recursive_deep_tree[(120, 4)] 699.2 KB 562.5 KB +24.31%

Tip

Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.


Comparing gabrielhnf:fix-mktemp-hidden-files (c9de5f7) with main (d09f351)

Open in CodSpeed

Footnotes

  1. 46 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mktemp not working to make hidden temp file

1 participant