You're supposed to use 'file' in the ofstream, not 'command'