 	.then ->
 		fs.chmod(binPath, '755')
 	.return(binPath)
+
+toPosixPath = (systemPath) ->
+	path = require('path')
+	systemPath.replace(new RegExp('\\' + path.sep, 'g'), '/')

						# if we need emulation
						if options.emulated and platformNeedsQemu()
							return transpose.transposeTarStream buildStream,
								hostQemuPath: qemuPath
								containerQemuPath: "/tmp/#{QEMU_BIN_NAME}"
						else
							return buildStream

		relPath = path.relative(path.resolve(dir), file)
		Promise.join relPath, fs.stat(file), fs.readFile(file),
			(filename, stats, data) ->
				pack.entryAsync({ name: toPosixPath(filename), size: stats.size, mode: stats.mode }, data)
	.then ->
		pack.finalize()
		return pack
