본문 바로가기

Code Habit

검색하기
Code Habit
프로필사진 코드베어

  • 분류 전체보기 (203)
Guestbook
Notice
Recent Posts
Recent Comments
Link
«   2025/08   »
일 월 화 수 목 금 토
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31
Tags
  • package
  • range
  • go언어
  • Close
  • http
  • Sync
  • File
  • write
  • C
  • c++
  • install
  • channel
  • FOR
  • Golang
  • 영화
  • bitcoin
  • 책
  • tcp
  • Linux
  • GO 언어
  • Python
  • window
  • mutex
  • API
  • windows
  • Callback
  • go
  • json
  • 리뷰
  • JavaScript
more
Archives
Today
Total
관리 메뉴
  • 글쓰기
  • 방명록
  • RSS
  • 관리

목록openfile (1)

Code Habit

Go 언어 ) 파일 쓰기

golang에서 os 패키지를 사용해 파일 Read/Write를 편하게 할 수 있다. 다음은 사용되는 함수이다. func OpenFile(name string, flag int, perm FileMode)(file *File, err error) : 파일 플래그, 파일 모드를 지정하여 파일 열기 func (f* File) Close() error : 파일을 닫음 func (f* File) Write(b []byte) (n int, err error) : 파일에 값을 씀. 쓴 데이터의 길이와 에러 값 리턴 func (f* File) Read() (b []byte)(n int, err error) : 파일의 내용을 읽음. byte형식으로 기록되며 읽은 Count와 에러 값 리턴 사용 예제 // main.go..

카테고리 없음 2020. 6. 16. 08:27
이전 Prev 1 Next 다음

Blog is powered by kakao / Designed by Tistory

티스토리툴바