Subversion Repositories DevTools

Rev

Rev 255 | Rev 5710 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 255 Rev 4928
Line 9... Line 9...
9
#
9
#
10
# Description   : This package contains functions to 'properties' files
10
# Description   : This package contains functions to 'properties' files
11
#                 These are used in a few placed to simplify Perl/Java
11
#                 These are used in a few placed to simplify Perl/Java
12
#                 interoperatbility
12
#                 interoperatbility
13
#
13
#
14
#                 A properteis file is a simple text file
14
#                 A properties file is a simple text file
15
#                 Line comments atsrt with a "#" and are not preserved
15
#                 Line comments atsrt with a "#" and are not preserved
16
#                 Non-empty lines are of the form
16
#                 Non-empty lines are of the form
17
#                     tag=value
17
#                     tag=value
18
# Usage:
18
# Usage:
19
#
19
#
Line 156... Line 156...
156
    $filename = $self->{FILE} unless ( $filename );
156
    $filename = $self->{FILE} unless ( $filename );
157
    Error ("No file to store properties") unless ( $filename );
157
    Error ("No file to store properties") unless ( $filename );
158
 
158
 
159
    open (PF, ">$filename") || Error ("Cannot create file: $filename", "Reason: $!");
159
    open (PF, ">$filename") || Error ("Cannot create file: $filename", "Reason: $!");
160
    print PF  '#' . localtime() . "\n";
160
    print PF  '#' . localtime() . "\n";
-
 
161
    print PF  "# This file is generated by JATS.\n";
-
 
162
    print PF  "#    Do not modify\n";
-
 
163
    print PF  "#    Do not place under version control\n";
161
    foreach my $name ( sort keys %{$self->{PROP}} )
164
    foreach my $name ( sort keys %{$self->{PROP}} )
162
    {
165
    {
163
        my $value = $self->{PROP}{$name};
166
        my $value = $self->{PROP}{$name};
164
        print PF "$name=$value\n";
167
        print PF "$name=$value\n";
165
    }
168
    }