Revision 4fc07be4
Von Sven Schöling vor mehr als 12 Jahren hinzugefügt
SL/SessionFile.pm | ||
---|---|---|
24 | 24 |
$file_name =~ s:.*/::g; |
25 | 25 |
$file_name = "${path}/${file_name}"; |
26 | 26 |
|
27 |
$self->file_name($file_name); |
|
28 |
|
|
27 | 29 |
if ($params{mode}) { |
28 | 30 |
my $mode = $params{mode}; |
29 | 31 |
|
... | ... | |
35 | 37 |
$self->fh(IO::File->new($file_name, $mode)); |
36 | 38 |
} |
37 | 39 |
|
38 |
$self->file_name($file_name); |
|
39 |
|
|
40 | 40 |
return $self; |
41 | 41 |
} |
42 | 42 |
|
43 |
sub open { |
|
44 |
my ($self, $mode) = @_; |
|
45 |
return $self->fh(IO::File->new($self->file_name, $mode)); |
|
46 |
} |
|
47 |
|
|
43 | 48 |
sub exists { |
44 | 49 |
my ($self) = @_; |
45 | 50 |
return -f $self->file_name; |
... | ... | |
139 | 144 |
it has been created for "customer.csv" then the value returned might |
140 | 145 |
be C<users/session_files/e8789b98721347/customer.csv>. |
141 | 146 |
|
147 |
=item C<open, %params]> |
|
148 |
|
|
149 |
Opens the file_name given at creation with the given parameters. |
|
150 |
|
|
142 | 151 |
=item C<exists> |
143 | 152 |
|
144 | 153 |
Returns trueish if the file exists. |
Auch abrufbar als: Unified diff
SL::SessionFile::Random - damit man sich nicht selber einen Namen ausdenken muss