pallassgj / bpipe

Automatically exported from code.google.com/p/bpipe
0 stars 1 forks source link

Determining input file type #88

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
This is a feature request. Modules have access to various information about 
their input, e.g. file name ($input), file prefix ($input.prefix). As far as I 
know, there is no built-in way to determine the type of input.

One way to achieve this is the following:

 process_file = {
    def ext = (input =~ /\.([^\.]*)$/)[0][1]
    // Do something
    // ...
 }

It would be great if one could simply call $input.ext or a similar shortcut.

Original issue reported on code.google.com by florent....@gmail.com on 14 Mar 2014 at 5:51