List components of an object

This might feel like a noob question, I just can't find this in the docs. I'm writing some procedural modelling scripts.

I have an polygon object name, $object, and I want to return a list of all the faces belonging to $object.

I can use filterExpand -sm 34 to get the names of the selected faces, but what about all of them?

2 approaches, either:
- there's a magical command that returns exactly what i'm looking for
or
- I figure out a way to select all the faces of an object and then use filterExpand.

thanks!

I've sort of solved the problem myself... I did it by selecting the whole object and then using

polyInfo -fn

and counting the number of face normals that are returned, and then doing something like:

string $cmd = "select -r poly.f[0:"+$count+"]";
eval $cmd;
string $faces[] = filterExpand -sm 34;

however i'm sure there's a better/more elegant way to do this. Any thoughts?

erm...

ls -fl ($object+".f[ * ]");

...?