I'm trying to create a function in c which scans the given directory for files of the given format (for example :- _sort.txt) and check if the directory contains that format file or not.
if directory contain file of that format then it should return -1 else 0. but i am stuck on how to scan the directory.can anyone help me with this.
i am fairly new to c so please bear with me.
operating system :- Linux