Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- 책
- bitcoin
- c++
- Close
- FOR
- channel
- C
- Python
- window
- Linux
- mutex
- Callback
- windows
- install
- 영화
- write
- API
- go
- GO 언어
- JavaScript
- tcp
- 리뷰
- go언어
- File
- package
- http
- Golang
- json
- range
- Sync
Archives
- Today
- Total
목록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