php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #887 Dosn't work at all ;-) Forget O_BINARY
Submitted: 1998-10-31 19:56 UTC Modified: 1998-11-23 01:07 UTC
From: edetocquev at teaser dot fr Assigned:
Status: Closed Package: dBase related
PHP Version: 3.0.5 OS: Windows 95
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: edetocquev at teaser dot fr
New email:
PHP Version: OS:

 

 [1998-10-31 19:56 UTC] edetocquev at teaser dot fr
There is a little bug in dbase function (dbase_create and dbase_open) when running PHP on Windows 95. Those functions open the file without the flag O_BINARY=0x8000 and dbase file are binary files. So when a record is added, the database is definitively corrupted.

I have found that I can pass 0x8002 to dbase_open, but there is no way to make dbase_create working properly, so I have had to modify the php3_dbase.dll.

But I think it's better to correct the bug ;-)

This append possibly on others database functions type, but I had tested only this one.

For example :

========= php-3.0.5/functions/dbase.c:500

    if ((fd = open(filename->value.str.val,
#if (WIN32|WINNT)
		O_BINARY|
#endif
		O_RDWR|O_CREAT, 0644)) < 0) {


========= php-3.0.5/dbase/dbf_head.c:229

#if (WIN32|WINNT)
    o_flags |= O_BINARY;
#endif
    if ((fd = open(cp, o_flags)) < 0) {

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1998-11-23 01:07 UTC] jim
Fix commited to CVS. Thanks for the hint.
 [2023-03-03 16:28 UTC] amanda at mail dot com
not working still (https://aimproviderportals.com)github.com
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Feb 05 12:01:32 2025 UTC