Filing should br the rare exception rather than the rule. Cotters come milled in various diameters, and the standards ahven't changed all that much over the years. The key is to
replace BOTH cotters with a matched pair from the same box. Replacing a single cotter is purely a crap shoot even if you try to match the angle.
Years ago (many years ago) they used to offer cotter filing jigs which were basically a clamp with a long shallow bore. They allowed filing to a consistent angle, and you controlled the depth by how far along the sloping hole you positioned the pin. Once the pin was clamped you filed flush to the top of the jig.
Here's a sketch of an improvised jig you can use to deepen the flat. With some creative improvisation you can do something similar to set a different angle (should you need to)
Minor correction, you don't have to match the depth of the angle cut, only the angle itself.