Opened 9 years ago

Last modified 5 months ago

#10325 accepted Patch - Feature

Modify to allow relative file names to be used in the links

Reported by: Nick Martin <njm@…> Owned by: sphery
Priority: minor Milestone: needs_triage
Component: Contributed Scripts & Apps Version: 0.24-fixes
Severity: medium Keywords: relative
Cc: Ticket locked: no


This is useful if your links directory and recordings directory are both in a directory tree exported by an NFS server. Links to absolute file names will be broken in the NFS clients, but links to relative file names will be ok.

E.g., if /home is exported on an NFS server with the following dirs:


...and the exported /home is mounted by an NFS client at /mnt/mythtv, then

/mnt/mythtv/nick/links/Title.mpg -> /home/mythtv/recordings/1004_20111224115800.mpg is broken
/mnt/mythtv/nick/links/Title.mpg -> ../../mythtv/recordings/1004_20111224115800.mpg is ok

The attached patch adds a --relative option to allow relative file names to be used in the links created by

Attachments (1) (1.8 KB) - added by Nick Martin <njm@…> 9 years ago.

Download all attachments as: .zip

Change History (8)

Changed 9 years ago by Nick Martin <njm@…>

Attachment: added

comment:1 Changed 9 years ago by sphery

Owner: changed from xris to sphery
Status: newaccepted

comment:2 Changed 9 years ago by sphery

Component: Apps - NuvexportContributed Scripts & Apps

comment:3 Changed 8 years ago by mythtvorg@…

There is a bug in this patch!

The added line:

$local_path = File::Spec->abs2rel($local_path, $dest);

Should be:

$local_path = File::Spec->abs2rel($local_path, $dirname);

Because $name may be of form "tv_show/episode" in which case the final directory will be attached to $name and missing from $dest.

Luckily, the existing code defines already: my $directory = dirname("$dest/$name");

comment:4 in reply to:  3 Changed 8 years ago by justpaul@…

Replying to mythtvorg@…: The "should be":

$local_path = File::Spec->abs2rel($local_path, $dirname);

Should really be:

$local_path = File::Spec->abs2rel($local_path, $directory);

$dirname is undefined.

comment:5 Changed 8 years ago by mythtv@…

You are absolutely right! For some reason, I typo'd when copying over the code...

comment:6 Changed 3 years ago by sphery

Duplicate ticket/patch posted at #13115 . The implementation from the other ticket is at ​ .

comment:7 Changed 5 months ago by Stuart Auchterlonie

Milestone: unknownneeds_triage
Note: See TracTickets for help on using tickets.