You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Ryan Bloom <rb...@covalent.net> on 2001/09/14 15:57:59 UTC

Re: [ADDON] apr_file_open_temp

On Friday 14 September 2001 11:04 am, Mladen Turk wrote:
> Hi,
>
> Here is some add to open.c to enable the temporary file creation.
> Don't know if this make sense in general, but its useful for me.
> I've make a patch for WIN32 only, but it should be straightforward for
> other platforms too.

I was actually looking for a function like this the other day.  I am pretty sure
that we actually have a function someplace in APR that creates a temp file.
I may be wrong about that though.  I'll take a look at this implementation later
this weekend, and if I can't find the other function, most likely I'll commit it.

Ryan
______________________________________________________________
Ryan Bloom				rbb@apache.org
Covalent Technologies			rbb@covalent.net
--------------------------------------------------------------

Re: [ADDON] apr_file_open_temp

Posted by Jeff Trawick <tr...@attglobal.net>.
Ryan Bloom <rb...@covalent.net> writes:


> File open shouldn't handle the temp file stuff.  That is overloading apr_file_open
> too much.  It already has too many different modes of operation.  We should
> have a separate API that creates a temp file.  That API should call apr_file_opn
> and apr_mkstemp under the covers.

not exactly... perhaps apr_file_open() and apr_file_create_temp()*
should call the common code under the covers for certain mundane
details

a concise set of code (e.g., apr_mkstemp()) needs to be in charge of
the filename generation and the open(), or security is hard to maintain

it should be simple for apr_file_open() on Unix to substitute the
open() call with an apr_mkstemp() call when appropriate, but a
separate API is fine... there will just be some shuffling around of
code from apr_file_open() to one or two utility routines called from
both apr_file_open() and apr_file_create_temp()*

*just a silly name I made up for the purposes of this post; not a real
 suggestion :)

-- 
Jeff Trawick | trawick@attglobal.net | PGP public key at web site:
       http://www.geocities.com/SiliconValley/Park/9289/
             Born in Roswell... married an alien...

Re: [ADDON] apr_file_open_temp

Posted by Ryan Bloom <rb...@covalent.net>.
On Friday 14 September 2001 09:22 am, Jeff Trawick wrote:
> Ryan Bloom <rb...@covalent.net> writes:
> > On Friday 14 September 2001 08:40 am, Ian Holsman wrote:
> > > apr_mkstemp?
> > > it doesn't return the filename,
> > > just the filehandle.
> >
> > That's the one I was looking for.  Thanks.
>
> yeah, but its usefulness is pretty limited (basically, for
> APR implementation details on Unix)
>
> we need apr_file_open() to do the magic for us (calling apr_mkstemp()
> on Unix but doing something else on Win32)

File open shouldn't handle the temp file stuff.  That is overloading apr_file_open
too much.  It already has too many different modes of operation.  We should
have a separate API that creates a temp file.  That API should call apr_file_opn
and apr_mkstemp under the covers.

Ryan
______________________________________________________________
Ryan Bloom				rbb@apache.org
Covalent Technologies			rbb@covalent.net
--------------------------------------------------------------

Re: [ADDON] apr_file_open_temp

Posted by Jeff Trawick <tr...@attglobal.net>.
Ryan Bloom <rb...@covalent.net> writes:

> On Friday 14 September 2001 08:40 am, Ian Holsman wrote:
> > apr_mkstemp?
> > it doesn't return the filename,
> > just the filehandle.
> 
> That's the one I was looking for.  Thanks.

yeah, but its usefulness is pretty limited (basically, for
APR implementation details on Unix)

we need apr_file_open() to do the magic for us (calling apr_mkstemp()
on Unix but doing something else on Win32)

-- 
Jeff Trawick | trawick@attglobal.net | PGP public key at web site:
       http://www.geocities.com/SiliconValley/Park/9289/
             Born in Roswell... married an alien...

Re: [ADDON] apr_file_open_temp

Posted by Ryan Bloom <rb...@covalent.net>.
On Friday 14 September 2001 08:40 am, Ian Holsman wrote:
> apr_mkstemp?
> it doesn't return the filename,
> just the filehandle.

That's the one I was looking for.  Thanks.

Ryan

>
> On Fri, 2001-09-14 at 06:57, Ryan Bloom wrote:
> > On Friday 14 September 2001 11:04 am, Mladen Turk wrote:
> > > Hi,
> > >
> > > Here is some add to open.c to enable the temporary file creation.
> > > Don't know if this make sense in general, but its useful for me.
> > > I've make a patch for WIN32 only, but it should be straightforward for
> > > other platforms too.
> >
> > I was actually looking for a function like this the other day.  I am
> > pretty sure that we actually have a function someplace in APR that
> > creates a temp file. I may be wrong about that though.  I'll take a look
> > at this implementation later this weekend, and if I can't find the other
> > function, most likely I'll commit it.
> >
> > Ryan
> > ______________________________________________________________
> > Ryan Bloom				rbb@apache.org
> > Covalent Technologies			rbb@covalent.net
> > --------------------------------------------------------------

-- 

______________________________________________________________
Ryan Bloom				rbb@apache.org
Covalent Technologies			rbb@covalent.net
--------------------------------------------------------------

RE: [ADDON] apr_file_open_temp

Posted by Mladen Turk <mt...@mappingsoft.com>.

> -----Original Message-----
> From: Ian Holsman [mailto:ianh@cnet.com]
> Sent: Friday, September 14, 2001 5:41 PM
> To: rbb@covalent.net
> Cc: Mladen Turk; dev@apr.apache.org
> Subject: Re: [ADDON] apr_file_open_temp
> 
> 
> apr_mkstemp?
> it doesn't return the filename,
> just the filehandle.

Know that, but its not the public function (at least not on WIN32).


MT.

Re: [ADDON] apr_file_open_temp

Posted by Ian Holsman <ia...@cnet.com>.
apr_mkstemp?
it doesn't return the filename,
just the filehandle.


On Fri, 2001-09-14 at 06:57, Ryan Bloom wrote:
> On Friday 14 September 2001 11:04 am, Mladen Turk wrote:
> > Hi,
> >
> > Here is some add to open.c to enable the temporary file creation.
> > Don't know if this make sense in general, but its useful for me.
> > I've make a patch for WIN32 only, but it should be straightforward for
> > other platforms too.
> 
> I was actually looking for a function like this the other day.  I am pretty sure
> that we actually have a function someplace in APR that creates a temp file.
> I may be wrong about that though.  I'll take a look at this implementation later
> this weekend, and if I can't find the other function, most likely I'll commit it.
> 
> Ryan
> ______________________________________________________________
> Ryan Bloom				rbb@apache.org
> Covalent Technologies			rbb@covalent.net
> --------------------------------------------------------------
-- 
Ian Holsman          IanH@cnet.com
Performance Measurement & Analysis
CNET Networks   -   (415) 364-8608