A file, being rigid, will leave a more level surface than sandpaper. Better IMO if the rim joint has a lip. If sandpaper is glued to a stick, that'll do the trick as well. BITD I generally didn't bother unless there was a discontinuity severe enough to cause a tick... tick... tick... tick... sound whenever the brakes were used.
AFA scratched braking surface on rims, IME it works better. I'm not sure where this fear of scratching rims has come from. I sand most rims on purpose if there are any issues whatsoever with brake squeal, typically using 220, maybe 320 grit sandpaper.
P600 scratches on aluminum are pretty fine. They'll polish right out with compound.
There is a related issue I've noticed that probably deserves a PSA. Please people, if you get grit stuck and embedded in your brake pads, dig it out! This used to be common knowledge. In the last few years, I've heard so many people's brakes making that tell tale scraping sound on descents, that I have to conclude that most people are not taught to clean brake pads any more.