Quantcast
Viewing latest article 1
Browse Latest Browse All 7

Retrieving file/directory name from stdin

I'm working on a command line application that accepts input via stdin redirection.
I want to add a feature that checks if the provided input is a directory. For example, if a directory is passed via redirection, it should be able to detect it.

For example,

$ ./app < d
d is a directory
$./app < f
f is not a directory

How can I check if the input is a directory? are there any libraries?

Read full topic


Viewing latest article 1
Browse Latest Browse All 7

Trending Articles