[Go] File 정보 확인
·
Go
Go File 정보 확인 package file import ( "fmt" "os" "runtime" "syscall" "time" ) const FILE_PATH = "data/big_data.txt" type myFile struct { file *os.File } func newMyFile(file *os.File) *myFile { f := myFile{ file: file, } return &f } func (f *myFile) showStat() { stat, err := f.file.Stat() if err != nil { panic(err) } /* type FileInfo interface { Name() string // base name of the file Size() int64 /..
[Go] 대용량 파일 chunk 단위로 나누기
·
Go
Go lang으로 대용량 파일 chunk 단위로 나누기 Go lang으로 대용량 파일에 대해서 chunk 단위로 나누어 보자. 나누기 위해서 우선 대용량 파일을 생성한 후 나누기를 진행 할 것이다. 대용량 파일 생성 파일 나누기 1. 대용량 파일 생성 package main import ( "fmt" "math" "os" "runtime" "strconv" "time" ) const MAX_CONCURRENT_JOB = 10 const NUMBER_OF_UNORDERED = 100000000 const BIG_DATA_ROOT = "data" const BIG_DATA_FILE_PATH = "data/big_data.txt" const FILE_CHUNK_SIZE = 10 * (1