@Override
	public int write(String path, Object fh, boolean isWritepage,
			ByteBuffer buf, long offset) throws FuseException {
		FileHandle handle = (FileHandle)fh;
		if (handle == null)
			return Errno.EBADSLT;
		if (handle.hasClosed)
			return Errno.EBADSLT;
		if (!handle.write)
			return Errno.EACCES;
		handle.isEmptyFile = false;
		try {
			fileSystem.write(handle, buf, offset);
		} catch (DriveFullException e) {
			return Errno.ENOSPC;
		} catch (PartIsLockedException e) {
			return Errno.EACCES;
		}
		return 0;
	}