@Override
	public void onFlushFileBuffers(String arg0, DokanFileInfo arg1)
			throws DokanOperationException {
		if (DEBUG)
			System.out.println("FlushFileBuffers: " + arg0);
		FileHandle handle;
		synchronized (handles)
		{
			handle = handles.get(arg1.handle);
		}
		if (handle == null)
			throw new DokanOperationException(net.decasdev.dokan.WinError.ERROR_INVALID_HANDLE);
		
		if (!handle.write)
			return;
			//throw new DokanOperationException(net.decasdev.dokan.WinError.ERROR_ACCESS_DENIED);
		
		try {
			fileSystem.flush(handle);
		} catch (DriveFullException e) {
			throw new DokanOperationException(net.decasdev.dokan.WinError.ERROR_DISK_FULL);
		} catch (Exception e)
		{
			e.printStackTrace();
		}
	}