# Tempfile.new("foo") --\> /tmp/foo123.0 \*NOT\* /tmp/foo.123.0 l

**URL:** <https://www.ruby-forum.com/t/tempfile-new-foo-tmp-foo123-0-not-tmp-foo-123-0-l/62674>\
**Category:** Ruby\
**Created:** [June 7, 2006, 7:12am UTC](https://www.ruby-forum.com/t/tempfile-new-foo-tmp-foo123-0-not-tmp-foo-123-0-l/62674 "2006-06-07T07:12:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![phallstrom](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/f475e1/32.png) [@phallstrom](https://www.ruby-forum.com/u/phallstrom)\
**Post date:** [June 7, 2006, 7:12am UTC](https://www.ruby-forum.com/t/tempfile-new-foo-tmp-foo123-0-not-tmp-foo-123-0-l/62674/1 "2006-06-07T07:12:25Z")

</div>

Hi all -

Just noticed that the documentation for Tempfile.new says:

```
Creates a temporary file of mode 0600 in the temporary directory whose
name is basename.pid.n ....

```

But it’s actually basenamepid.n. Line 70 of tempfile.rb says:

```
sprintf('%s%d.%d', basename, $$, n)

```

Who and where should I let know about this?

Thanks!

-philip

---

<div class="post-metadata">

**Author:** ![phallstrom](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/f475e1/32.png) [@phallstrom](https://www.ruby-forum.com/u/phallstrom)\
**Post date:** [June 7, 2006, 9:23am UTC](https://www.ruby-forum.com/t/tempfile-new-foo-tmp-foo123-0-not-tmp-foo-123-0-l/62674/2 "2006-06-07T09:23:44Z")

</div>

Hi,

In message “Re: Tempfile.new(“foo”) → /tmp/foo123.0 _NOT_  
/tmp/foo.123.0 like docs says…”  
on Wed, 7 Jun 2006 14:09:04 +0900, Philip H.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) writes:

|Just noticed that the documentation for Tempfile.new says:  
|  
| Creates a temporary file of mode 0600 in the temporary directory whose  
| name is basename.pid.n …  
|  
|But it’s actually basenamepid.n. Line 70 of tempfile.rb says:  
|  
| sprintf(‘%s%d.%d’, basename, $$, n)

Hmm, it’s a documentation error. Thank you for the report.

```
						matz.

```
