rack-devel archive mirror (unofficial) https://groups.google.com/group/rack-devel
 help / color / mirror / Atom feed
From: Randy Fischer <randy.fischer@gmail.com>
To: rack-devel@googlegroups.com
Subject: Re: Setting tmp dir
Date: Tue, 8 Jun 2010 14:56:03 -0400	[thread overview]
Message-ID: <AANLkTimh1Ar93Za0G3RhsxCVYKRhiCVgqohPhi7z4c6O@mail.gmail.com> (raw)
In-Reply-To: <AANLkTimEOd5fQRuNYpt6AqHSMTw_2D5xdIWsjGWRD3m0@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1309 bytes --]

I think you can work around this with an environment variable;
tempfile uses tmpdir,  which:

  def Dir::tmpdir
    tmp = '.'
    if $SAFE > 0
      tmp = @@systmpdir
    else
      for dir in [ENV['TMPDIR'], ENV['TMP'], ENV['TEMP'],
                  ENV['USERPROFILE'], @@systmpdir, '/tmp']
        if dir and File.directory?(dir) and File.writable?(dir)
          tmp = dir
          break
        end
      end
      File.expand_path(tmp)
    end
  end



On Tue, Jun 8, 2010 at 2:21 PM, Michael Fellinger <m.fellinger@gmail.com>wrote:

> On Wed, Jun 9, 2010 at 3:14 AM, Chris Cherry <ctcherry@gmail.com> wrote:
> > Fellow developers,
> >
> > I would like to set the tmp directory Rack is using to another
> > directory, instead of /tmp/. Is anyone currently doing this? I don't
> > see an obvious way to do it, am I missing something?
>
> There is no option for this currently, Tempfile allows a parameter for
> the directory, but it's not passed.
> The line in question is
> http://github.com/rack/rack/blob/master/lib/rack/utils.rb#L450
> and I think we could add a class instance variable with accessors to
> adjust it, defaulting to Dir.tmpdir.
> If you want to, you can submit a patch for that, or overwrite
> Dir.tmpdir after requiring tmpdir.
>
> --
> Michael Fellinger
> CTO, The Rubyists, LLC
>

[-- Attachment #2: Type: text/html, Size: 3546 bytes --]

  reply	other threads:[~2010-06-08 18:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-08 18:14 Setting tmp dir Chris Cherry
2010-06-08 18:21 ` Michael Fellinger
2010-06-08 18:56   ` Randy Fischer [this message]
2010-06-08 20:06     ` Chris Cherry
2010-06-09  2:00       ` Randy Fischer
2010-06-09 16:43         ` Chris Cherry

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://groups.google.com/group/rack-devel

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTimh1Ar93Za0G3RhsxCVYKRhiCVgqohPhi7z4c6O@mail.gmail.com \
    --to=rack-devel@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).