http://perlmaven.com/what-is-a-text-file

https://cygwin.com/cygwin-ug-net/using-textbinary.html

Text and Binary modes

The Issue

On a UNIX system, when an application reads from a file it gets exactly what's in the file on disk and the converse is true for writing. The situation is different in the DOS/Windows world where a file can be opened in one of two modes, binary or text. In the binary mode the system behaves exactly as in UNIX. However on writing in text mode, a NL (\n, ^J) is transformed into the sequence CR (\r, ^M) NL.

This can wreak havoc with the seek/fseek calls since the number of bytes actually in the file may differ from that seen by the application.

The mode can be specified explicitly as explained in the Programming section below. In an ideal DOS/Windows world, all programs using lines as records (such as bashmakesed ...) would open files (and change the mode of their standard input and output) as text. All other programs (such as catcmptr ...) would use binary mode. In practice with Cygwin, programs that deal explicitly with object files specify binary mode (this is the case of od, which is helpful to diagnose CR problems). Most other programs (such as sedcmptr) use the default mode.

Text and Binary modes的更多相关文章

  1. 使你的C/C++代码支持Unicode(CRT字符串处理的所有API列表,甚至有WEOF字符存在)

    悉Microsoft支持Unicode的方式. 它的主要目的是方便你查询相关的数据类型和函数,以及修正相应的拼写错误. I18nGuy 主页 XenCraft (Unicode 咨询公司) Engli ...

  2. Unicode 和 ANSI

    Project Properties -> General-> Character set,里面显示了是不是unicode. Unicode处理String的方式不一样,一定要注意!!   ...

  3. How can I read binary files from Resources

    How can I read binary files from Resourceshttp://answers.unity3d.com/questions/8187/how-can-i-read-b ...

  4. 转 Oracle全文检索http://docs.oracle.com/cd/E11882_01/text.112/e24436/toc.htm

    SQL > exec ctx_ddl.create_preference ('my_test_lexer','chinese_lexer') : PL/SQL 过程成功完成 SQL > E ...

  5. Unity使用Resources读取Resources路径下的二进制文件(Binary Data)必须使用 .bytes扩展名

    将某二进制文件放在Resources目录下,希望用Resources.Load<TextAsset>的方式读取,发现TextAsset是null 查阅Unity文档得知,使用Resourc ...

  6. python3.4 build in functions from 官方文档 翻译中

    2. Built-in Functions https://docs.python.org/3.4/library/functions.html?highlight=file The Python i ...

  7. python3的文件操作

    open的原型定义在bultin.py中,是一种内建函数,用于处理文件 open(file, mode='r', buffering=None, encoding=None, errors=None, ...

  8. 在vi中使用perltidy格式化perl代码

    格式优美的perl代码不但让人赏心悦目,并且能够方便阅读. perltidy的是sourceforge的一个小项目,在我们写完乱七八糟的代码后,他能像变魔术一样把代码整理得漂美丽亮,快来体验一下吧!! ...

  9. ActiveMQ笔记——技术点汇总

    目录 · Introduction to ActiveMQ · Installing ActiveMQ · Message-oriented middleware · JMS specificatio ...

随机推荐

  1. 电商类Web原型制作分享——聚美优品

    这是一家化妆品限时特卖商城.作为美妆电商类网站的佼佼者,网站以用户体验为核心,画面主色调符合女性消费者审美.排版整齐,布局合理.网站用弹出面板实现点击弹出内容,鼠标悬停文字按钮颜色改变等交互效果. 本 ...

  2. UI设计:掌握这6点,轻松0到1

    非科班出身能成为UI设计师吗? 答案是肯定的.世上无难事,只怕有心人.只要找对方法.坚持不懈,即便是零基础也能学好UI设计. 那么零基础学习UI设计,需要学习哪些知识?我们要从哪些地方学起?怎么系统学 ...

  3. stl学习记录(1)

    Effective STL 中文版学习记录 条款4 判断容器是否为空 使用empty而不是size().size()操作在实现上不是一个时间常数操作条款5 尽量使用区间成员函数代替它们的单元素兄弟.S ...

  4. 【DBCP】DBCP基本配置和重连配置+spring中配置

    最近在看一些dbcp的相关内容,顺便做一下记录,免得自己给忘记了.   1. 引入dbcp (选择1.4) <dependency> <groupId>com.alibaba. ...

  5. 第三次Scrum编码冲刺!!!

    第三次冲刺  一.第三次冲刺任务 ! 在已有的基础上实现图书馆管理员对图书信息的查询以及对图书借阅情况的查询. 二.用户故事 本次的用户是图书馆的管理员 用户输入对应的管理员的账号和密码 用户选择图书 ...

  6. 2018.09.08 AtCoder Beginner Contest 109简要题解

    比赛传送门 水题大赛? 全是水题啊!!! T1 ABC333 就是判断是不是两个数都是奇数就行了. 代码: #include<bits/stdc++.h> using namespace ...

  7. 2018.07.26NOIP模拟 魔法数字(数位dp)

    魔法数字 题目背景 ASDFZ-NOIP2016模拟 题目描述 在数论领域中,人们研究的基础莫过于数字的整除关系.一般情况下,我们说整除总在两个数字间进行,例如 a | b(a能整除b)表示 b 除以 ...

  8. 【翻译】追溯“typeof null”的历史

    我的翻译小站:https://www.zcfy.cc/article/the-history-of-typeof-null 翻译原文链接:http://2ality.com/2013/10/typeo ...

  9. JVM性能调优监控工具jps、jstack、jmap、jhat、jstat, hprof使用详解

    JDK本身提供了很多方便的JVM性能调优监控工具,除了集成式的VisualVM和jConsole外,还有jps.jstack.jmap.jhat.jstat等小巧的工具,本博客希望能起抛砖引玉之用,让 ...

  10. Linux监控本机当前状态命令

    vmstat 1.简介 vmstat命令是最常见的Linux监控工具,可以查看系统的状态值,其中包括:CPU.内存.虚拟内存.I/O情况. 2.参数说明 命令格式:  vmstat [-a] [-n ...