Automattic\WooCommerce\Internal\Admin\Logging\FileV2

File::get_file_size()publicWC 1.0

Get the size of the file in bytes. Or false if the file isn't readable.

Method of the class: File{}

No Hooks.

Return

Int|false.

Usage

$File = new File();
$File->get_file_size();

File::get_file_size() code WC 9.3.3

public function get_file_size() {
	try {
		$filesystem = FilesystemUtil::get_wp_filesystem();

		if ( ! $filesystem->is_readable( $this->path ) ) {
			return false;
		}

		$size = $filesystem->size( $this->path );
	} catch ( Exception $exception ) {
		return false;
	}

	return $size;
}