From:             info at skfree dot sk
Operating system: Debian/Windows
PHP version:      5.2.6
PHP Bug Type:     dBase related
Bug description:  dbase_create creates file with corrupted header 

Description:
------------
Create a dbase File with Version 5.2.6 will get currupted dbase header.

Can not be opened from Excel or Borlands Dbase-Engine

similar bug Bug #41394 seems to be not resolved.

Reproduce code:
---------------
// database "definition"
                                        
$def = array(
            array("date",       "D"),
            array("name",        "C",  50),
            array("age",       "N",   3, 0),
            array("email",       "C", 128),
            array("ismember", "L")
        );
                                                                        
                                   
// creation
$db = dbase_create("/tmp/test.dbf", $def);

if(!$db) print "<strong>Error!</strong>";
dbase_close($db);


Expected result:
----------------
Hexdump of Dbase File with PHP 5.2.1:
00000000  03 6b 05 0f 00 00 00 00  c1 00 bf 00 00 00 00 00              
       
                   ^^
                    Day: 15
                ^^
                 Month: 5
             ^^
              Year from 1900: 107 + 1900 = 2007
          ^^
           Dbase-Version: 3 = Dbase Level 5


Actual result:
--------------
Hexdump of Dbase File with PHP 5.2.6:

00000000  03 6C 0B 0A 00 00 00 00  c1 00 bf 00 00 00 00 00

-- 
Edit bug report at http://bugs.php.net/?id=46536&edit=1
-- 
Try a CVS snapshot (PHP 5.2):        
http://bugs.php.net/fix.php?id=46536&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):        
http://bugs.php.net/fix.php?id=46536&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):        
http://bugs.php.net/fix.php?id=46536&r=trysnapshot60
Fixed in CVS:                        
http://bugs.php.net/fix.php?id=46536&r=fixedcvs
Fixed in CVS and need be documented: 
http://bugs.php.net/fix.php?id=46536&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=46536&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=46536&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=46536&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=46536&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=46536&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=46536&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=46536&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=46536&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=46536&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=46536&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=46536&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=46536&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=46536&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=46536&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=46536&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=46536&r=mysqlcfg

Reply via email to