I'm working in an office environment. Bunch a people scan things and need to move documents from place to place, access hardware accross the network, etc.
One of the things we have, is an old scanner/printer.. one of those four bajillion dollar chunks of mountain.. you know.. those cannon printers that scan, print, collate, make coffee, etc.
We have it set up so that when you scan, you can choose from a list of places to send to. The software is set up on this machine to read from a text file (yeah.. you see where this is going? :) ) a list of directories etc that are valid options. Everytime a user scans and selects from the list, the text file is loaded by the orinter hardware.
There are about 400 directories, they change sometimes. Some poor bastard was entering and keeping them up to date manually. So, now we have a perl script that makes the list.
When something changes, the script can be re-run.
Another option is to put it on cron.. And then... What I really really like... And what this post is about - and i need opinions.. is...
I was thinking..
I want to have list.txt - which is really a perl script that spits out list.txt- you know? spits out mime type, and content.
And I was also thinking of doing this in other things.. for example, having a image.png file.. that's really a perl script, that is accessed being called by html liks <img src="image.png">, and when called, something happens- a notice is sent, the image is generated from scratch, whatever..
So I would end up with files like list.txt and image.png, whatever.doc which output that expected content... but the file itself is really a program.
Now, I know how to do this- nothing crazy. What I want to know is. Should I do this, regularly?
Is this looking for trouble? Am I potentially going to cause problems? I want to use this in websites, office networking hacks.. Is this bad juju? Am I breaking some unspoken *ix rule about being clever?
What if I die and someone else takes this job.. Would I be leaving a legacy of insanity or would this be a regular common *ix hack that someone should figure out ?
In reply to scripts posing as data files, nitch nitch or uber cool? by leocharre
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |