#48526 [Com]: When using the b flag i get a error: Warning: fopen(/tmp/12/foo2.txt
| From: | jason at ovitech dot nl | Date: | Fri, 12 Jun 2009 13:17:03 +0000 |
| Subject: | #48526 [Com]: When using the b flag i get a error: Warning: fopen(/tmp/12/foo2.txt | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-138244@lists.php.net to get a copy of this message | ||
ID: 48526
Comment by: jason at ovitech dot nl
Reported By: jason at ovitech dot nl
Status: Feedback
Bug Type: Filesystem function related
Operating System: OSX
PHP Version: 5.2.9
New Comment:
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?
Previous Comments:
------------------------------------------------------------------------
[2009-06-11 20:22:53] kalle@php.net
Without looking deeply into this, have you tried with fopen(..., 'wb')
instead of bw ?
------------------------------------------------------------------------
[2009-06-11 09:26:56] 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
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=48526&edit=1