Bo Lindbergh writes:
In article <20060901184007.24952.7@llama.ing-simmons.net>,
nick@ing-simmons.net (Nick Ing-Simmons) wrote:
Rafael Garcia-Suarez <rgarciasuarez@gmail.com> writes:
On 26/08/06, via RT Bo Lindbergh wrote:
Truncating a string isn't an expensive operation,
so is this really too much to ask?
A quick look at the implementation suggests that truncate() only works
for filehandles currently.
But a PerlIO::Scalar "is" a file handle :-(

That said we there isn't a ftruncate() hook in PerlIO virtualization
so I don't know what we do...
Adding _only_ ftruncate to PerlIO is not the Right Thing to do,
because the next bug report would be "Why can't you use the -s
operator to get the length of the scalar used by a
PerlIO::Scalar handle?"
And I would agree with that.
But then we have a bunch of other fields in stat that we would have to
lie about or fake by tracking last time touched etc.
And once you have both fstat and
ftruncate, you might as well complete the set and add fchown,
fchmod, and futimes too.
If we fake times in our fake stat then fake futimes makes sense.
But chown an chmod make little sense to me - only the current process
can access the scalar so current UID is owner (and can't exec it).

We could accept the calls and set errno to nearest code that made sense,
or perhaps just set the mode so that fake stat saw it.

Have we missed any more fd related calls?
If there anything else that we can do to filehandles via perl
interface that we missed?

Search Discussions

Discussion Posts


Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 5 of 6 | next ›
Discussion Overview
groupperl5-porters @
postedAug 26, '06 at 9:47p
activeSep 2, '06 at 5:45p



site design / logo © 2019 Grokbase