[Swift-user] passing a file as an argument

Michael Wilde wilde at mcs.anl.gov
Sun Jan 31 12:20:02 CST 2010


Jamal, for this, you pass the file name on the command line as a script argument after all the swift command arguments, and pick it up inside your swift script with the @arg() function, which is like argv in C (except indexed by name rather than position). Its described in the User Guide.

- Mike


----- "J A" <jamalphd at gmail.com> wrote:

> Hi:
> 
> how can I pass a file when executing swift, so i want to do something
> like this:
> 
> $ swift file.txt
> 
> 
> how do I catch the file inside the code?
> 
> Thanks,
> Jamal
> 
> _______________________________________________
> Swift-user mailing list
> Swift-user at ci.uchicago.edu
> http://mail.ci.uchicago.edu/mailman/listinfo/swift-user



More information about the Swift-user mailing list