开发者

How to read from file, which name is "-"

how to rea开发者_开发百科d content of a file which name is "-" (dash, not stdin)?


From any programming language, just open the file. A single dash is certainly no special file name and can be opened like any other one.

From a shell, you can use ./-:

$ some_command --out foo --in ./-


Assuming you're using a utility that represents STDIN/STDOUT with -, try using ./- or -- -.


cat <- will work under *nix.


No differently that from any other file.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜