Search code examples
cmacosunixfilesystemsfinder

How to open a folder with GUI from c program?


I'm writing a program searching a file in Mac OS filesystem. I would like to how to pop up the GUI folder with finder once my program found the file. Is this possible? Is there any system calls I can using to open a directory with finder? It is written in C

Thanks for any input!


Solution

  • I think you want to use the open command. You can use open . to open the finder window corresponding to the current directory, or open document.pdf to open a particular document with its corresponding default application.