linux标准代码,标准管道

linux标准代码,标准管道,linux,pipe,stdout,stdin,Linux,Pipe,Stdout,Stdin,我有一块砖头,雪碧。 我在Debain 8 Kali Linux中有一个可执行文件,代码如下: 包括 包括 包括 /** *要使用此文件,请将旧格式的精灵导入stdin,然后 *将stdout重定向到所选内容的第二个文件。精灵头 *将被转换。此工具没有错误检查,并假定 *雪碧头。它只是为了方便而提供的。 */ int main int argc,char*argv[] { uint8_t zero=0; uint8_t val; int ret; /*以旧宽度阅读*/ ret=fread&va

我有一块砖头,雪碧。 我在Debain 8 Kali Linux中有一个可执行文件,代码如下:

包括 包括 包括 /** *要使用此文件,请将旧格式的精灵导入stdin,然后 *将stdout重定向到所选内容的第二个文件。精灵头 *将被转换。此工具没有错误检查,并假定 *雪碧头。它只是为了方便而提供的。 */ int main int argc,char*argv[] { uint8_t zero=0; uint8_t val; int ret; /*以旧宽度阅读*/ ret=fread&val,val尺寸,1,标准尺寸; /*写入空值,然后新建*/ fwrite&zero,大小为0,1,标准输出; fwrite&val,val的大小,1,标准值; /*以旧高度阅读*/ ret=fread&val,val尺寸,1,标准尺寸; /*写入空值,然后新建*/ fwrite&zero,大小为0,1,标准输出; fwrite&val,val的大小,1,标准值; /*位深度和格式的直接副本*/ ret=fread&val,val尺寸,1,标准尺寸; fwrite&val,val的大小,1,标准值; ret=fread&val,val尺寸,1,标准尺寸; fwrite&val,val的大小,1,标准值; /*假设水平和垂直跨步为1*/ val=1; fwrite&val,val的大小,1,标准值; fwrite&val,val的大小,1,标准值; printf%d\n,ret;//设置以避免出现奇怪的错误 /*现在只需复制字节,直到流结束*/ 费斯丁 { ret=fread&val,val尺寸,1,标准尺寸; 如果!费斯丁 { /*只有在最后一次读取未进行eof时才进行复制*/ fwrite&val,val的大小,1,标准值; } } 返回0;
} 如果要将文件brick.sprite的内容重定向到convtool的stdin,请使用运算符

要完成上述两种变体,请执行以下操作:

convtool < brick.sprite > brick2.sprite
cat brick.sprite | convtool > brick2.sprite
第一个变体schould也适用于windows和osx外壳,它不是linux特有的

一些提示:

// This is complete nonsense. 
// you use the name of linux tools/commands as argument of convtools.
convtool grep <brick.sprite date > brick2.sprite

//This looks like that it goes in the right way...
// this is one of the right ways ;-)
convtool < brick.sprite > brick2.sprite

// your convtool does not use arguments.
// But i think this would work too. "cat" is nonsense.
convtool cat <brick.sprite> brick2.sprite

// after performing this command you have written the eeror output stderr 
// to your brick2.sprite file and you have overwritten your 
// brick.sprite file with the std out. (I hope you have a copy ;-)
convtool 2> brick2.sprite > brick.sprite

什么类型的文件是brick.sprite?非常感谢!这是一个png文件,转换成二进制的.sprite。谢谢你,我从来没有想过我会得到这样的Answare。你帮了我的忙。
convtool < brick.sprite > brick2.sprite
cat brick.sprite | convtool > brick2.sprite
// This is complete nonsense. 
// you use the name of linux tools/commands as argument of convtools.
convtool grep <brick.sprite date > brick2.sprite

//This looks like that it goes in the right way...
// this is one of the right ways ;-)
convtool < brick.sprite > brick2.sprite

// your convtool does not use arguments.
// But i think this would work too. "cat" is nonsense.
convtool cat <brick.sprite> brick2.sprite

// after performing this command you have written the eeror output stderr 
// to your brick2.sprite file and you have overwritten your 
// brick.sprite file with the std out. (I hope you have a copy ;-)
convtool 2> brick2.sprite > brick.sprite