How does "PCK Packer" class work?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Corruptinator

There isn’t much information about how the PCK Packer class works, I was trying to write a code to pack imported files into a compressed PCK file which in theory should be useful for patches and or downloadable content.

func _pck_Queue(files,savepath):
	print("PCKaging!")
	#percentage = 0
	var packaging = PCKPacker.new()
	packaging.pck_start(savepath, 0)
	for i in range(0,files.size()):
		percentage = i
		print(percentage)
		get_node("/root/Node/WindowDialog/VBoxContainer/ProgressBar").value = percentage
		var directory = files[i].get_base_dir()
		var file = files[i].get_file()
		print(directory+"/"+file)
		packaging.add_file((directory+"/"),file)
	_post_Pack()
	packaging.flush(false)
	pass

I have no idea if the code above is the right way to go but is there any ideas? Options to how I can fix this? Thanks.