/**
 * Creates n number of files and returns an array of pointer references to the created files.
 */
Creates n number of files and returns an array of pointer references to the created files.
/ ** * Creates n number of files and returns an array of pointer references to the created files . * /
func (props *LoadGenProperties) fileRef() ([]*os.File, error) {
	var fileArray = make([]*os.File, props.FileCount, props.FileCount)
	var err error = nil
	for n := 0; n < int(props.FileCount); n++ {
		fileVar := props.FilePath
		if props.FileCount > 1 {
			if strings.Contains(fileVar, ".") {
				fileVar = strings.Replace(fileVar, ".", strconv.Itoa(n)+".", 1)
			} else {
				fileVar = fileVar + strconv.Itoa(n)
			}
		}
		fileArray[n], err = os.OpenFile(fileVar, os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0666)
		if err != nil {
			break
		}
	}
	return fileArray, err
}
func ( props * LoadGenProperties ) fileRef ( ) ( [ ] * os . File , error ) { var fileArray = make ( [ ] * os . File , props . FileCount , props . FileCount ) var err error = nil for n := 0 ; n < int ( props . FileCount ) ; n ++ { fileVar := props . FilePath if props . FileCount > 1 { if strings . Contains ( fileVar , " " ) { fileVar = strings . Replace ( fileVar , " " , strconv . Itoa ( n ) + " " , 1 ) } else { fileVar = fileVar + strconv . Itoa ( n ) } } fileArray [ n ] , err = os . OpenFile ( fileVar , os . O_WRONLY | os . O_CREATE | os . O_APPEND , 0666 ) if err != nil { break } } return fileArray , err }
Creates n number of files and returns an array of pointer references to the created files.
Creates n number of files and returns an array of pointer references to the created files .
//attach file number before the file extension