Three related command line tools:

e.g.

$ folderID /Users/Shared
2739013

$ folderName 2739013
/Users/Shared

$ volumeID /Volumes/HardDisk
-100

Binaries are here.

Sources (including XCode projects) are here:

This is free software. I hope you will find it useful.