On a filesystem with a maximum filename size of 256, the following will die because of the naming scheme of the temporary file used within spew:
path("LONG!" x 51)->spew(@data);
In this case, the target filename is legal, but the name of the temporary file is not.
A possible solution would be to set $temp = tempfile(DIR => $resolved_path->parent). I'm sure there is good reason, however, why that approach was not used at the offset. I suppose this could work:
I would feel compelled to make sure that file didn't already exist before writing to it. Admittedly, I would add that check in the current code. I recognize that I am paranoid from years of working with data that delights in hitting edge cases, but it is not impossible for those added random digits to stomp an existing file...
On a filesystem with a maximum filename size of 256, the following will die because of the naming scheme of the temporary file used within spew:
In this case, the target filename is legal, but the name of the temporary file is not.
A possible solution would be to set
$temp = tempfile(DIR => $resolved_path->parent)
. I'm sure there is good reason, however, why that approach was not used at the offset. I suppose this could work:I would feel compelled to make sure that file didn't already exist before writing to it. Admittedly, I would add that check in the current code. I recognize that I am paranoid from years of working with data that delights in hitting edge cases, but it is not impossible for those added random digits to stomp an existing file...