This may be a failure of symlink due to .jpg being a binary file. A .png file, linked to through Windows 7 symbolic links, cannot be opened by Windows Photo Viewer, Gimp, or Firefox through the symbolic link, whether you make that link using Perl and Win32::Symlink, or from the Cygwin command line, and whether you use absolute or relative paths. This may be some bizarre Windows protection problem, although links to text files made in the same way have no problem, and the "diff" command indicates no difference between the .png and the symlink to it.

This, for example, links link.png to graph.png, but you can't open the PNG through link.png:

require Win32::Symlink; Win32::Symlink->import(); use warnings; use strict; use Cwd; my $cwd = getcwd; my $a = 'stories/graph.png'; my $link = 'link.png'; unlink("$cwd/$link") if -e $link; symlink("$cwd/$a", "$cwd/$link"); exit; $diff link.png stories.graph.png [no difference]
This also does not work:
ln -s stories/graph.png link.png
Nor this:
export pwd=`pwd` ln -s $pwd/stories/graph.png $pwd/link.png
It appears to be a bug in how Windows 7 implements symlinks, having nothing to do with Perl. BUT, hard links DO work:
ln stories/graph.png link.png
produces a link that you can use. The 'symlink' command is supposed to be equivalent to "ln -s", which does not work.

In reply to Re: (Updated -- Apache2 is irrelevant) Apache2 and symlinks by shagbark
in thread (Updated -- Apache2 is irrelevant) Apache2 and symlinks by Lawliet

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.