Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: (Updated -- Apache2 is irrelevant) Apache2 and symlinks

by shagbark (Acolyte)
on Jul 12, 2012 at 04:48 UTC ( [id://981298]=note: print w/replies, xml ) Need Help??


in reply to (Updated -- Apache2 is irrelevant) Apache2 and symlinks

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://981298]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (2)
As of 2024-04-24 23:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found