public function set_file_attr( $file, $attr, $value, $recursive = false ) {

		$file_atts = $this->get_file( $file );

		if ( false === $file_atts ) {
			return false;
		}

		if ( 'contents' === $attr ) {
			if ( 'file' === $file_atts->type ) {
				$file_atts->size = mb_strlen( $value, '8bit' );
			} else {
				return false;
			}
		}

		if ( true === $recursive ) {
			$this->set_file_attr_recursive( $file_atts, $attr, $value );
		}

		$file_atts->$attr = $value;

		return true;
	}