首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Exiftool不能打印到ProcessBuilder中的文件吗?

Exiftool不能打印到ProcessBuilder中的文件吗?
EN

Stack Overflow用户
提问于 2018-07-17 11:36:40
回答 0查看 85关注 0票数 0

我使用ProcessBuilderexiftool的输出打印到一个文件中。我正在尝试对一个.opus文件exiftool Aero.opus > Aero.txt运行这个命令。这在终端上运行得很好,但在processbuilder中,它似乎在解析它时遇到了麻烦。

这是它的一个简单的程序。请注意,该目录设置为/home/sarah,并且Aero.opus文件存在于该目录中。

还要注意的是,输出会打印到控制台,而不是应该打印到文件中,并且它不能识别>操作符。

代码语言:javascript
复制
@Test
public void testExifprocess() throws IOException {
    //File Located at /home/sarah/Aero.opus
    ProcessBuilder builder = new ProcessBuilder("exiftool", "Aero.opus", ">", "Aero.txt").directory(Paths.get("/home/sarah").toFile())
            .inheritIO();
    builder.start();
}

下面是输出:

代码语言:javascript
复制
Running com.protonmail.sarahszabo.stellaropusconverter.tests.StellarDiskManagerTest
File not found: >
File not found: Aero.txt
======== Aero.opus
ExifTool Version Number         : 10.80
File Name                       : Aero.opus
Directory                       : .
File Size                       : 13 MB
File Modification Date/Time     : 2018:06:29 19:19:08-04:00
File Access Date/Time           : 2018:07:16 23:20:27-04:00
File Inode Change Date/Time     : 2018:07:16 23:20:27-04:00
File Permissions                : rw-rw-r--
File Type                       : OPUS
File Type Extension             : opus
MIME Type                       : audio/ogg
Opus Version                    : 1
Audio Channels                  : 2
Sample Rate                     : 48000
Output Gain                     : 1
Vendor                          : Lavf58.17.100
Title                           : Aero
Artist                          : Daniel Deluxe
Picture Type                    : Front Cover
Picture MIME Type               : image/png
Picture Description             : Daniel Deluxe -- Aero.png
Picture Width                   : 1280
Picture Height                  : 720
Picture Bits Per Pixel          : 0
Picture Indexed Colors          : 0
Picture Length                  : 946992
Picture                         : (Binary data 946992 bytes, use -b     option to extract)
    1 image files read
    2 files could not be read

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

主文件夹:

我的操作系统是Kubuntu18.04,带有Java 8_171。

EN

回答

页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51372871

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档