# File lib/kirbybase.rb, line 1520
    def change_column_default_value(table, col_name, value)
        with_write_lock(table.name) do
            fptr = open(table.filename, 'r')
            new_fptr = open(table.filename+'temp', 'w')

            line = fptr.readline.chomp

            if line[0..0] == 'Z'
                header_rec = unencrypt_str(line[1..-1]).split('|')
            else
                header_rec = line.split('|')
            end
            
            if header_rec[table.field_names.index(col_name)+3] =~ \
             /Default->/
                hr_chunks = \
                 header_rec[table.field_names.index(col_name)+3].split(':')

                if value.nil?
                    hr_chunks = hr_chunks.delete_if { |x| x =~ /Default->/ }
                    header_rec[table.field_names.index(col_name)+3] = \
                     hr_chunks.join(':')
                else
                    hr_chunks.collect! do |x|
                        if x =~ /Default->/
                            'Default->%s' % value
                        else
                            x
                        end
                    end
                    header_rec[table.field_names.index(col_name)+3] = \
                     hr_chunks.join(':')
                end              
            else
                if value.nil?
                else
                    header_rec[table.field_names.index(col_name)+3] += \
                     ':Default->%s' % value
                end    
            end

            if line[0..0] == 'Z'
                new_fptr.write('Z' + encrypt_str(header_rec.join('|')) +
                 "\n")
            else
                new_fptr.write(header_rec.join('|') + "\n")
            end

            begin
                while true
                    new_fptr.write(fptr.readline)
                end
            # Here's how we break out of the loop...

            rescue EOFError
            end

            # Close the table and release the write lock.

            fptr.close
            new_fptr.close
            File.delete(table.filename)
            FileUtils.mv(table.filename+'temp', table.filename)
        end
    end