views:

265

answers:

3

Im running Cygwin on XP, iv got a bash script that i would like to execute a media file but get the error "cannot execute binary file"

Is this possible? can cygwin call a media file like a mp3 or wav file

thanks

Donaldo

+1  A: 

No. The association from file type to program is a Windows setting, and without explicitly tying into that scheme, you'll have to explicitly call a program with the file name as a command line argument. In fact, this is exactly what the OS does under the covers using the file associations that are set up - it passes the file name as a command line argument (along with, possibly, other information) to the associated program.

Harper Shelby
+1  A: 

A media file isn't in and of itself executable. You need to invoke a media player that can play that kind of file, and pass it the file name as a parameter.

T.E.D.
+2  A: 

It looks like this is achievable with start.exe:

http://f1.aaa.livedoor.jp/~fexx/tools/start-en.html

Appears to operate much like Windows command line's start command. Stick it in your cygwin path and:

$ start file.mp3

John Barrett