You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Stas Bekman <st...@stason.org> on 2001/11/23 11:54:16 UTC
porting Apache::File issues
Doug MacEachern wrote:
> all of the ap_ functions that were in the 1.x Apache::File live in
> different places now, so Apache::compat just needs to 'use' the modules
> with those functions. the Apache::File::{new,open} methods should be
> deprecated (now that we have 'open my $fh, ...'), but stubs put in
> Apache::compat.
I think the following addition to compat.pm covers Apache::File
compatibility. The only issue is with tmpfile. Where should it live?
package Apache::File;
sub new {
my($class) = shift;
my $fh;
my $self = bless \$fh, ref($class)||$class;
return @_ ? $self->open(shift) : $self;
}
sub open {
my($self, $filename) = @_;
open $$self, $filename;
}
sub close {
my($self) = shift;
close $$self;
}
sub tmpfile {
# ???
}
# the following functions now live in Apache::Response
use Apache::Response;
# * discard_request_body
# * meets_conditions
# * set_content_length
# * set_etag
# * set_last_modified
# * update_mtime
# the following functions now live in Apache::RequestRec
use Apache::RequestRec;
# * mtime
--
_____________________________________________________________________
Stas Bekman JAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide http://perl.apache.org/guide
mailto:stas@stason.org http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org
Re: porting Apache::File issues
Posted by Doug MacEachern <do...@covalent.net>.
On Wed, 5 Dec 2001, Stas Bekman wrote:
> why do you want to know the filename?
it doesn't matter why, that is what the 1.x api supports.
i don't remember in detail, lincoln wrote the original routine, it is used
in some eagle book examples.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org
Re: porting Apache::File issues
Posted by Stas Bekman <st...@stason.org>.
Doug MacEachern wrote:
> On Thu, 29 Nov 2001, Stas Bekman wrote:
>
>
>>BTW, from perl571delta.pod:
>>
>><Quote>
>>Anonymous temporary files are available without need to
>>'use FileHandle' or other module via
>>
>> open($fh,"+>", undef) || ...
>>
>>That is a literal undef, not an undefined value.
>></Quote>
>>
>
> nice. but that doesn't give you a filename like Apache::File->tmpfile
> does, so we'd still need the old code for Apache::compat.
why do you want to know the filename?
> p.s.
> plan to commit that patch soon? a friend at work is trying to get
> Apache::MP3 working with 2.0 and needs the Apache::File compat.
yup, hopefully today
_____________________________________________________________________
Stas Bekman JAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide http://perl.apache.org/guide
mailto:stas@stason.org http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org
Re: porting Apache::File issues
Posted by Doug MacEachern <do...@covalent.net>.
On Thu, 29 Nov 2001, Stas Bekman wrote:
> BTW, from perl571delta.pod:
>
> <Quote>
> Anonymous temporary files are available without need to
> 'use FileHandle' or other module via
>
> open($fh,"+>", undef) || ...
>
> That is a literal undef, not an undefined value.
> </Quote>
nice. but that doesn't give you a filename like Apache::File->tmpfile
does, so we'd still need the old code for Apache::compat.
p.s.
plan to commit that patch soon? a friend at work is trying to get
Apache::MP3 working with 2.0 and needs the Apache::File compat.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org
Re: porting Apache::File issues
Posted by Stas Bekman <st...@stason.org>.
>>compatibility. The only issue is with tmpfile. Where should it live?
>>
>
> copy-n-paste the 1.x code for now. in the future, would
> like to see APR::File->mktemp (apr_file_mktemp) and a perlio layer defined
> in terms of apr_file_t to use it.
ok
BTW, from perl571delta.pod:
<Quote>
Anonymous temporary files are available without need to
'use FileHandle' or other module via
open($fh,"+>", undef) || ...
That is a literal undef, not an undefined value.
</Quote>
_____________________________________________________________________
Stas Bekman JAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide http://perl.apache.org/guide
mailto:stas@stason.org http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org
Re: porting Apache::File issues
Posted by Doug MacEachern <do...@covalent.net>.
On Fri, 23 Nov 2001, Stas Bekman wrote:
> I think the following addition to compat.pm covers Apache::File
looks good, +1
> compatibility. The only issue is with tmpfile. Where should it live?
copy-n-paste the 1.x code for now. in the future, would
like to see APR::File->mktemp (apr_file_mktemp) and a perlio layer defined
in terms of apr_file_t to use it.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org