Skip to content

Commit c708bc5

Browse files
committed
hard link patch from George Nassas <gnassas*mac*com>
1 parent 928eee9 commit c708bc5

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

trunk/export/NUV_SQL.pm

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,15 @@ package export::NUV_SQL;
156156
# Copy the file
157157
else {
158158
print "\nCopying $episode->{'filename'} to $self->{'path'}/$nuv_file\n";
159-
copy("$episode->{'filename'}", "$self->{'path'}/$nuv_file")
160-
or die "Couldn't copy specified .nuv file: $!\n\n";
159+
# use hard links when copying within a filesystem
160+
if ((stat($episode->{'filename'}))[0] == (stat($self->{path}))[0]) {
161+
link("$episode->{'filename'}", "$self->{'path'}/$nuv_file")
162+
or die "Couldn't hard link specified .nuv file: $!\n\n";
163+
}
164+
else {
165+
copy("$episode->{'filename'}", "$self->{'path'}/$nuv_file")
166+
or die "Couldn't copy specified .nuv file: $!\n\n";
167+
}
161168
}
162169
}
163170

0 commit comments

Comments
 (0)