This creates the resource fork in the file - if you don't do this, there'll be no information to copy out. Mac OSX change file association per file on the command line, To change the association of a single file from the command line, first create a file of the right type, and manually change its association to the application you want it to open in.
Document To change the association of a single file from the command line, first create a file of the right type, and manually change its association to the application you want it to open in. Change file association in terminal?, duti is a command-line tool written by Andrew Mortensen, designed to set default applications for document types and URL schemes on Mac OS X.