php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30253 tempnam creates a non accesable file
Submitted: 2004-09-27 12:21 UTC Modified: 2004-09-28 15:24 UTC
From: jorisvanmontfort at chello dot nl Assigned:
Status: Closed Package: IIS related
PHP Version: 4.3.9RC3 OS: windows 2000
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: jorisvanmontfort at chello dot nl
New email:
PHP Version: OS:

 

 [2004-09-27 12:21 UTC] jorisvanmontfort at chello dot nl
Description:
------------
When i use the tempnam() function a file is succefully created but it seems that the file is not writeable.

I am running php 4.3.9 on IIS 5 as CGI on windows 2000.

Reproduce code:
---------------
<?
// create a tempfile for the thumbnail
$tempThumbnailFile = tempnam ("tmp", "thumb");
// write the contents of the zip entry to the tempfile
$handle = fopen($tempThumbnailFile, 'a+');
fwrite($handle, $docData);
fclose($handle);
/*
	DO SOME PROCESSING ON THE FILE
*/
// Read the contents of the files into a string.
$thumbnailData = fread(fopen($tempThumbnailFile, "r+"), filesize($tempThumbnailFile));
?>

Expected result:
----------------
I expect the a tempfile to be created and I expect to be able to acces this file for write acces in order to manipulate the file contents.

Actual result:
--------------
Warning: filesize(): Stat failed for C:\Windows\TEMP\thu8450.tmp (errno=2 - No such file or directory) and so on.................. The file is created i can find it in explorer.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-09-28 15:24 UTC] aidan@php.net
Same as #23069
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Jul 14 22:01:35 2025 UTC