본문 바로가기
프로그래밍/Study C

I/O Stream

by Damon11 2022. 10. 11.

● Wide Character 는 왜 존재하는가?

UTF-16 이 보편화, Unicode의 등장, 다른 Character 인코딩 형식의 등장

이전의 C 언어는 8bit 로 문자를 표현했다.?

정확히는 main function에서 일반적으로 argument를 ANSI라고 불리는 형식으로 받았었지만

UniCode 가 등장한 후에는 16bit, 32bit의 형식이 나타났고, 따라서 wide character 라는 형식이 필요해졌다.

 

● Binary Stream vs Text Stream

한 가지만 쓰지 왜 2가지로 나누어 사용하는가?

Binary Stream 이 훨씬 범용적이다. Text Stream이 읽지 못하는 것을 Binary Stream으로 해결할 수도 있다.

  • text stream은 254 character보다 긴 binary stream을 읽지 못한다. (\n)
  • 시스템에 따라서, text stream 은 printing characters, horizontal tab characters, newlines 와 같은 다른 캐릭터를 다루지 못할 수 있다. binary stream은 전혀 문제없이 다룬다.
  • new line character 앞에 space character가 있을 때 text stream에선 new line character 가 사라질 수도 있다.
  • More generally, there need not be a one-to-one mapping between characters that are read from or written to a text stream, and the characters in the actual file.

Text Stream 의 장점?

Text-Oriented Program 에서 사용

Since a binary stream is always more capable and more predictable than a text stream, you might wonder what purpose text streams serve. Why not simply always use binary streams? The answer is that on these operating systems, text and binary streams use different file formats, and the only way to read or write “an ordinary file of text” that can work with other text-oriented programs is through a text stream.

출처 : https://www.gnu.org/software/libc/manual/html_node/Binary-Streams.html

 

 

● Opening file with Exclusive Mode

파일이 이미 존재할 경우 파일 생성 불가능

 

'파일 권한' 은 유닉스 운영체제에만 존재하는가? 윈도우에는 존재하지 않는가?

 

● File Stream vs Character Stream

 

 

ANSI vs ASCII

 

 

 Binary Encoding vs Base64

 

'프로그래밍 > Study C' 카테고리의 다른 글

Debugging, Testing and Analysis  (0) 2022.11.07
'Static' in C language  (0) 2022.10.27
Program Structure  (0) 2022.10.19
PreProcessing  (0) 2022.10.17
Buffer  (0) 2022.10.11

댓글