 	async.waterfall([
 
 		(callback) ->
-			fs.open(devicePath, 'rs+', null, callback)
+			fs.open(devicePath, DISK_IO_FLAGS, null, callback)
 
 		(fd, callback) ->
 			buffer = new Buffer(bufferSize)

progressStream = require('progress-stream')

IS_WINDOWS = os.platform() is 'win32'

exports.rescanDrives = (callback) ->
	return callback() if not IS_WINDOWS

	if not IS_WINDOWS and not fs.existsSync(devicePath)
		return callback(new Error("Invalid device: #{devicePath}"))

	imageFileSize = fs.statSync(imagePath).size

	if imageFileSize is 0
		return callback(new Error("Invalid OS image: #{imagePath}. The image is 0 bytes."))

	progress = progressStream
		length: imageFileSize
