user2754899
user2754899

Reputation: 39

How to identify if file is a named pipe in java

How can we identify whether given File is a named pipe? Any way to use same code for both Linux and Windows.

Upvotes: 3

Views: 1094

Answers (1)

rolfl
rolfl

Reputation: 17707

You may have some success with isOther() in the NIO2 Files API. This tells you that it is not a file, not a directory, and not a link. That leaves a named pipe, a unix socket, or a device..... perhaps that's enough for you?

Upvotes: 4

Related Questions