LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 02-17-2010, 01:23 PM   #1
batonac
LQ Newbie
 
Registered: Feb 2010
Posts: 5

Rep: Reputation: 0
Lightbulb Can Linux serve "virtual" files which are (re)produced by script when accessed?


Is it possible to run a Linux file server which lists files which don't actually exist, but rather are generated on the fly by a (bash) script that runs and returns file data every time the given file is requested??

For example, I have a huge store of XCF images. I want to keep the XCF images, but for many purposes I must access these images as PNG files. I don't want to keep multiple copies of each image, and I don't want to have to save an image twice each time I edit it. What I would like is a FTP or SMB file server which lists each image twice, but serves the original every time the XCF is accessed, and uses imagemagick to convert the XCF into PNG on the fly, and serves that data every time the PNG is accessed.

I know that there is a time trade off here, but this scenario totally fits my use-case, and I would deeply appreciate if anyone could direct me in accomplishing this.

This is an new experience for me. I've never heard of anyone trying to do this, and I can't seem to type the right google searches to find others on the world who have done the same thing. Yet it seems like it should be totally possible through the power of Linux.

I guess this would be like a really fancy and advanced link, but one which links to info that has yet to be produced. (Kinda like /dev/random ?)
 
Old 02-17-2010, 01:50 PM   #2
fang0654
Member
 
Registered: Oct 2003
Location: New York, NY
Distribution: Ubuntu
Posts: 103

Rep: Reputation: 25
Your best bet is using a web application, that lists out the files, and does the conversion when you click, and serves up converted file.

It should be pretty simple to do in php/perl. I don't know of any projects off the top of my head that do this already, though.
 
Old 02-17-2010, 04:05 PM   #3
batonac
LQ Newbie
 
Registered: Feb 2010
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by fang0654 View Post
Your best bet is using a web application, that lists out the files, and does the conversion when you click, and serves up converted file.

It should be pretty simple to do in php/perl. I don't know of any projects off the top of my head that do this already, though.
Thanks for a quick response!

I wish I didn't have to learn a new language, and this probably won't work with my specific program needs, but maybe I can just run a cron script that creates actual copies of the images and updates them daily, although this would not be ideal in my mind. Any other ideas would be great...
 
Old 02-17-2010, 04:10 PM   #4
fang0654
Member
 
Registered: Oct 2003
Location: New York, NY
Distribution: Ubuntu
Posts: 103

Rep: Reputation: 25
Check this out:

http://sourceforge.net/projects/simpledirectory/

You would have to add a function in there for file conversion, but it shouldn't be very difficult.
 
Old 03-04-2010, 07:41 AM   #5
batonac
LQ Newbie
 
Registered: Feb 2010
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by fang0654 View Post
Check this out:

http://sourceforge.net/projects/simpledirectory/

You would have to add a function in there for file conversion, but it shouldn't be very difficult.
Thanks for the suggestion, I think that instead of this, I will probably just make a cron script which (re)produces png files for all of the xcf files in my directory, on a given time basis (every night).

If anyone knows how to do otherwise, I would be glad to know.

Thanks again, the Linux community rocks!!
 
Old 03-04-2010, 08:02 AM   #6
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,457
Blog Entries: 11

Rep: Reputation: 183Reputation: 183
Maybe check out fuse. It just seams right for your purpose. Also you would have to get your hands dirty with programming.

Here are to links one for fuse

http://en.wikipedia.org/wiki/FUSE_(linux)

and one that shows how to create your own filesystem for use with fuse

http://www.ibm.com/developerworks/linux/library/l-fuse/
 
  


Reply

Tags
bash, ftp, smb


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
bash script: using "select" to show multi-word options? (like "option 1"/"o zidane_tribal Programming 6 03-21-2013 10:35 AM
Trying to get SARG to display reports with Sorting by "Website Accessed" bhowerton Linux - Software 0 10-01-2008 09:43 AM
Can't install "glibmm" library. "configure" script can't find "sigc++-2.0&q kornerr Linux - General 4 05-10-2005 02:32 PM
Is it possible to make a "file" that can change its output when accessed? oot Linux - General 5 05-11-2003 08:30 PM


All times are GMT -5. The time now is 12:48 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration