@Override
	public int truncate(String path, long size) throws FuseException {
		try {
			if (fileSystem.isReadOnly())
				return Errno.EROFS;
			FileHandle handle = fileSystem.openFile(path, true, true);
			fileSystem.setLength(handle, size);
			fileSystem.close(handle);
		} catch (PathNotFoundException e) {
			return Errno.ENOENT;
		} catch (AccessDeniedException e) {
			return Errno.EACCES;
		} catch (NotAFileException e) {
			return Errno.EISDIR;
		} catch (DriveFullException e) {
			return Errno.ENOSPC;
		}
		return 0;
	}