Changeset 6625
- Timestamp:
- Mar 16, 2006, 5:40:46 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/DataStore/lib/DataStore/File.pm (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/DataStore/lib/DataStore/File.pm
r6615 r6625 1 1 # Copyright (C) 2006 Joshua Hoblitt 2 2 # 3 # $Id: File.pm,v 1. 9 2006-03-17 01:11:23jhoblitt Exp $3 # $Id: File.pm,v 1.10 2006-03-17 03:40:46 jhoblitt Exp $ 4 4 5 5 package DataStore::File; … … 18 18 use Digest::MD5::File qw( file_md5_hex ); 19 19 use File::stat; 20 use POSIX ();21 20 use Params::Validate qw( validate SCALAR ); 22 21 … … 128 127 type => SCALAR, 129 128 regex => $STD_FIELD, 129 optional => 1, 130 130 }, 131 131 bytes => { 132 132 type => SCALAR, 133 133 regex => $BYTE_FIELD, 134 optional => 1, 134 135 }, 135 136 md5sum => { 136 137 type => SCALAR, 137 138 regex => $MD5_FIELD, 139 optional => 1, 138 140 }, 139 141 type => { … … 143 145 sub { exists $KNOWN_FILE_TYPES{$_[0]} }, 144 146 }, 147 optional => 1, 145 148 }, 146 149 }, … … 181 184 object. 182 185 183 XXX writing the file into memory or to a filehandle will be impl imented upon186 XXX writing the file into memory or to a filehandle will be implemented upon 184 187 request. 185 188 … … 192 195 =item * filename 193 196 194 The filename/path to save the file to disk as. 197 The filename/path to save the file to disk as. It is the user's responsibility 198 to make sure that this is a valid filename/path. 195 199 196 200 =back … … 206 210 filename => { 207 211 type => SCALAR, 208 regex => qr/\S+/, # string with atleast 1 non WS char 209 callbacks => { 210 'write access' => sub { 211 POSIX::access($_[0], &POSIX::W_OK); 212 }, 213 }, 212 regex => qr/\S+/, # string with at least 1 non WS char 214 213 }, 215 214 },
Note:
See TracChangeset
for help on using the changeset viewer.
