Changeset 15085
- Timestamp:
- Sep 28, 2007, 11:10:58 AM (19 years ago)
- File:
-
- 1 edited
-
trunk/DataStore/scripts/dsget (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/DataStore/scripts/dsget
r15082 r15085 3 3 # Copyright (C) 2006 Joshua Hoblitt 4 4 # 5 # $Id: dsget,v 1. 5 2007-09-28 21:05:16jhoblitt Exp $5 # $Id: dsget,v 1.6 2007-09-28 21:10:58 jhoblitt Exp $ 6 6 7 7 use strict; … … 48 48 # can we truely write to filename? 49 49 { 50 # open file for read y/write but not create50 # open file for read/write but not create 51 51 my $fh; 52 52 if (open($fh, '+<', $filename)) { 53 53 # do nothing and fall through 54 54 } elsif (open($fh, '>>', $filename)) { 55 # this is the "stomp on it behavior" this probably shouldn't be the 56 # default and it may make sense to check the md5sum/bytes count of the 57 # files that's already in place to see if we really need to re-fetch it 55 58 unlink $filename or die "can't unlink $filename: $!"; 56 59 } else { … … 59 62 } 60 63 64 my $dirname = dirname($filename); 65 66 if (!-d $dirname) { 67 # create path and possibly fix up permissions 68 mkpath([$dirname], 1, 0775); 69 } 70 61 71 my $tmp = File::Temp->new( 62 DIR => dirname($filename),72 DIR => $dirname, 63 73 TEMPLATE => '.' . basename($filename) . 'XXXX', 64 74 SUFFIX => '.tmp',
Note:
See TracChangeset
for help on using the changeset viewer.
