 			length: file.length
 		}
 
+	deleteFile: (fileName) ->
+		file = this.findOne fileName
+		if not file?
+			return undefined
+
+		return this.remove fileName
+
 
 RocketFile.FileSystem = class
 	constructor: (config={}) ->


		this.store = new Grid(db, mongo)
		this.findOneSync = Meteor.wrapAsync this.store.collection(this.name).findOne.bind this.store.collection(this.name)

	findOne: (fileName) ->
		return this.findOneSync {_id: fileName}

	createWriteStream: (fileName, contentType) ->
		self = this

	stat: (fileName) ->
		return this.statSync path.join this.absolutePath, fileName

	remove: (fileName) ->
		return this.unlinkSync path.join this.absolutePath, fileName

	getFileWithReadStream: (fileName) ->
		try
			stat = this.stat fileName
			rs = this.createReadStream fileName

			return {
				readStream: rs
				# contentType: file.contentType
				length: stat.size
			}
		catch e
			return undefined

	deleteFile: (fileName) ->
		try
			stat = this.stat fileName
			return this.remove fileName
		catch e
			return undefined
