Skip to content

Fix stat/file tests on filehandles and stat _ parsing#245

Merged
fglock merged 1 commit intomasterfrom
fix-bytecode-my-extraction
Feb 27, 2026
Merged

Fix stat/file tests on filehandles and stat _ parsing#245
fglock merged 1 commit intomasterfrom
fix-bytecode-my-extraction

Conversation

@fglock
Copy link
Owner

@fglock fglock commented Feb 27, 2026

Summary

  • Store filePath in RuntimeIO when opening files so stat($fh) and file test operators (-f $fh, etc.) can access the underlying file's metadata instead of returning EBADF
  • Fix stat _ / lstat _ parsing where _ was matched by the ALLCAPS bareword regex and treated as a filehandle glob instead of the special last-stat-buffer identifier
  • Refactor FileTestOperator to extract shared evaluateFileTest() method used by both string and filehandle code paths
  • Refactor Stat.java to extract shared statPath() method for both string and filehandle stat

Test plan

  • ./gradlew test passes
  • ExifTool.t: 30/35 pass (up from 24/35) — tests 3, 6, 16, 17, 28, 31 now pass

Generated with Devin

Store filePath in RuntimeIO when opening files so stat($fh) and
file test operators (-f $fh, etc.) can access the underlying file
metadata instead of returning EBADF.

Fix stat _ / lstat _ parsing where _ was matched by the ALLCAPS
bareword regex and treated as a filehandle glob instead of the
special last-stat-buffer identifier.

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <noreply@cognition.ai>
@fglock fglock merged commit 00fbb2f into master Feb 27, 2026
2 checks passed
@fglock fglock deleted the fix-bytecode-my-extraction branch February 27, 2026 07:01
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.

1 participant