Changeset 14175


Ignore:
Timestamp:
2007-06-13T13:26:29+12:00 (14 years ago)
Author:
qq6
Message:

Determine the name of the operating system, make the file extension .bdb for MAC, otherwise it's .ldb extension

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/perllib/util.pm

    r11179 r14175  
    711711# test to see whether this is a big or little endian machine
    712712sub is_little_endian {
    713     return (ord(substr(pack("s",1), 0, 1)) == 1);
     713    # To determine the name of the operating system, the variable $^O is a cheap alternative to pulling it out of the Config module;
     714    # What we do here is, if it is a Macintosh machine (i.e. the Darwin operating system), regardless it is running on the IBM power-pc cpu or it is the x86 Intel-based chip with a power-pc emulator running on top of it, it requires the big-endian data format in the gdbm database file, we make the file extension .bdb; otherwise it's .ldb extension.
     715       
     716    #return 0 if $^O =~ /^darwin$/i;
     717    return 0 if $ENV{'GSDLOS'} =~ /^darwin$/i;
     718    return (ord(substr(pack("s",1), 0, 1)) == 1);
    714719}
    715720
Note: See TracChangeset for help on using the changeset viewer.