I recently had cause to go delving into the documentation for Ruby's
open() method. While I found the information I needed fairly quickly, I was appalled to discover that open() will happily open a pipe to a subprocess (if the path parameter starts with "|") and even fork your app (if the path parameter is
(
Read more... )
Comments 8
Reply
Reply
I can see one place where it would be useful. When you go to open a file in a GUI app, it'd be nice to be able to put in a URL or some other thing. It'd be better, though, if instead of a open() handling all of them, they provided you with a function that would give you the appropriate object to call .open() on to handle that path. That would let the user explicitly support arbitrary special paths like that without a huge amount of code, but leave the unsuspecting from inadvertently creating a huge security hole in their system because they used open() and someone sent them a |- from a web page.
filetype.gethandler(path).open(path)
Reply
Reply
Of course, you know what this means. You need to make your own programming language and then get with the marketers at MicroSoft to make sure it's almost the only one used. ;)
Reply
Reply
Reply
Reply
Leave a comment