为什么 Createfile() 没有二进制标志 [英] Why doesn't Createfile() have a binary flag

查看:43
本文介绍了为什么 Createfile() 没有二进制标志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Windows 编程的一大乐趣是记得在所有文件打开调用中放置wb"或rb"或 ios::binary,这样 Windows 就不会愉快地转换所有 0x13.

One of the great joys of windows programming is remembering to put 'wb' or 'rb' or ios::binary in all the file open calls so that Windows doesn't merrily convert all your 0x13s.

我只需要转换一堆很好的标准代码来使用 Createfile() 来获得某个标志 - 我突然想到没有办法指定二进制.
它怎么知道?我真的不希望它改变我的 MP4 流中的字节,非常感谢.

I just had to convert a bunch of nicely standard code to use Createfile() to get a certain flag - and it occurred to me that there is no way to specify binary.
How does it know? I really don't want it changing bytes in my MP4 stream thank-you-very-much.

推荐答案

因为 CreateFile 不进行文本模式"/换行转换.这些是在更高级别处理的,无论是在 CRT 的 FILE 中还是 C++ 的 iostreams 中.

Because CreateFile doesn't do "text-mode"/newline conversions. Those are handled at a higher level, either in FILE for the CRT or iostreams for C++.

这篇关于为什么 Createfile() 没有二进制标志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆