Perl database problem

Charles Wilson cwilson@ece.gatech.edu
Sat Oct 27 17:53:00 GMT 2001


On Fri, 26 Oct 2001, Goksun Ilhan wrote:
> I am trying to run a Perl program in cygwin. When I
> create the database using dbmopen command, it looks
> like it's working (it's only creating .pag file, not
> .dir file). However, when I try to read something from
> the database, it cannot open the file. I run the
> program on a UNIX machine and it works. Is there way
> to run that program using cygwin?

cygwin's perl uses gdbm to provide back end database services (including
NDBM:: GDBM:: and ODBM::).  The dbmopen() command that you reference
indicates that you are using the NDBM:: flavor.  When gdbm is used in its
ndbm-emulation mode, it stores the data in the .pag file -- but creates a
.dir file as a HARD LINK so that the on-disk footprint of this
gdbm-masquerading-as-ndbm is the same as REAL ndbm databases.

However, hard links don't work on FAT drives, only NTFS drives.  (No, we
can't change gdbm to use symlinks instead -- the hard link is necessary
because REAL ndbm expects both files to have the same timestamp.  With
hardlinks, they will.  with symlinks, they won;t).

Solution?  Don't use ndbm.  (NDBM::)  Use gdbm.

Or, make sure your databases are created on an NTFS drive.

--Chuck



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list