Jeffrey L. Roberts
Jeffrey L. Roberts

Reputation: 2994

Possible to symlink a file to a web url?

We currently have a challenge where the ideal solution would be to symlink a file to a web URL...

image.jpg -> http://www.host.com/images/image.jpg

Is this possible?

Upvotes: 9

Views: 6125

Answers (3)

Pavel Alexeev
Pavel Alexeev

Reputation: 6081

On mac I successfully used this great tool by maxogden, which also using FUSE:
https://github.com/maxogden/mount-url

brew install osxfuse
npm install -g mount-url

Then

mount-url "https://url-to-10-gb-video-file-on-some-external-cloud-storage/video.mp4?xxx=yyy"

This would create a symlink for the file named video.mp4 in the current directory.
Not too fast access speed, but works.

Upvotes: 2

that other guy
that other guy

Reputation: 123470

There are several nice and interesting solutions here. I especially like @ArjunShankar's fuse solution. In the spirit of keeping it simple though, perhaps a file in /etc/cron.daily with

#!/bin/sh
cd /your/dir && wget -N http://www.host.com/images/image.jpg

would be a lot simpler and Good Enough(TM)?

Upvotes: 2

Slartibartfast
Slartibartfast

Reputation: 1623

Maybe a named pipe that you feed with a wget for the file?

Edit - Not wget. You can work with linx -dump. So -

mkfifo reddit
links -dump reddit.com > reddit
cat reddit

Upvotes: 6

Related Questions