php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48526 When using the b flag i get a error: Warning: fopen(/tmp/12/foo2.txt
Submitted: 2009-06-11 09:26 UTC Modified: 2009-06-19 01:00 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: jason at ovitech dot nl Assigned:
Status: No Feedback Package: Filesystem function related
PHP Version: 5.2.9 OS: OSX
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jason at ovitech dot nl
New email:
PHP Version: OS:

 

 [2009-06-11 09:26 UTC] jason at ovitech dot nl
Description:
------------
When I open a file with the b flag in it. for example bw I get the error that the file does not exists. That is correct and I want fopen to create the file for me and set the pointer on the beginning of the code. that is why I use the w flag. I have used the b flag because of the note that is underneath the fopen manual file on the site./

Reproduce code:
---------------
$fp = fopen($this->_file, "bw");

Expected result:
----------------
A new file created in /tmp/12 called foo2.txt

Actual result:
--------------
Warning: fopen(/tmp/12/foo2.txt) [function.fopen]: failed to open stream: No such file or directory in /Users/jason/Sites/zf/myclass.php on line 168

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-06-11 20:22 UTC] kalle@php.net
Without looking deeply into this, have you tried with fopen(..., 'wb') instead of bw ?
 [2009-06-12 13:17 UTC] jason at ovitech dot nl
No I did not. Now I have and it seems to work.
But what is the difference? shouldn't have work anyway since these are just flags you pass to the function?
 [2009-06-19 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 06:01:29 2024 UTC