Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Making a perl program look like a regular file on Win32?

by Roger (Parson)
on Mar 03, 2004 at 12:11 UTC ( [id://333518]=note: print w/replies, xml ) Need Help??


in reply to Making a perl program look like a regular file on Win32?

I did wonder if there was a Windows app to give me this functionality, but I can't find anything.

Yeah there is, it's called the device driver kit. :-)
http://www.microsoft.com/whdc/ddk/winddk.mspx

From what I read in your post, I have a feeling that you are not looking for a solution that simply preprocess the CSV and fire-off the dos app, but rather you are looking for something that hooks into the file open and file access. So that when your program, say, opens 'generate.pl' for read, it actually runs the perl script, and read from the text file instead. Kind of transparent to the DOS application.

So basically you want to create a device driver that hooks into the file I/O subsystem under Windows. When a process tries to open a file, it checks the extension of the file, if it matches 'pl', then it executes the perl script, generates the CSV file, and then open the CSV file instead.

So the answer is yes, it is possible. But a bit insane. :-)

Update: The Win32::Pipe module mentioned above by matija is certainly worth a try, before you diving deeper into Windows internals. But that's only half the solution, you will still need to hook into the Windows I/O subsystem somehow to trigger the execution of the Perl script.

  • Comment on Re: Making a perl program look like a regular file on Win32?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (6)
As of 2024-04-23 11:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found