Last active
August 29, 2015 13:57
-
-
Save peczenyj/9725430 to your computer and use it in GitHub Desktop.
This script creates one fuse filesystem with one file, cat.jpg, with a random kitten image (from thecatapi.com)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! perl | |
| use strict; | |
| use warnings; | |
| use LWP::Simple; | |
| use Fuse::Simple qw(main); | |
| my $mountpoint = $ARGV[0]; | |
| die "usage: $0 <directory>\n" if ! defined $mountpoint || ! -d $mountpoint; | |
| main( | |
| mountpoint => $mountpoint, | |
| "/" => { | |
| 'cat.jpg' => sub { | |
| get('http://thecatapi.com/api/images/get?format=src&type=jpg'); | |
| }, | |
| }, | |
| ); | |
| print "don't forget 'fusermount -u $mountpoint'\n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment