// nextVolName updates name to the next filename in the archive.
nextVolName updates name to the next filename in the archive.
// nextVolName updates name to the next filename in the archive .
func (v *volume) nextVolName() {
	var lo, hi int
	dir, file := filepath.Split(v.name)
	if v.num == 0 {
		ext := filepath.Ext(file)
		switch strings.ToLower(ext) {
		case "", ".", ".exe", ".sfx":
			file = file[:len(file)-len(ext)] + ".rar"
		}
		if a, ok := v.fileBlockReader.(*archive15); ok {
			v.old = a.old
		}
	}
	if !v.old {
		m := reNew.FindStringSubmatchIndex(file)
		if m == nil {
			v.old = true
		} else {
			lo = m[2]
			hi = m[3]
			if lo < 0 {
				lo = m[4]
				hi = m[5]
			}
		}
	}
	if v.old {
		m := reOld.FindStringSubmatchIndex(file)
		lo = m[2]
		hi = m[3]
	}
	n, err := strconv.Atoi(file[lo:hi])
	if err != nil {
		n = 0
	} else {
		n++
	}
	vol := fmt.Sprintf("%0"+fmt.Sprint(hi-lo)+"d", n)
	v.name = dir + file[:lo] + vol + file[hi:]
}
func ( v * volume ) nextVolName ( ) { var lo , hi int dir , file := filepath . Split ( v . name ) if v . num == 0 { ext := filepath . Ext ( file ) switch strings . ToLower ( ext ) { case " " , " " , " " , " " : file = file [ : len ( file ) - len ( ext ) ] + " " } if a , ok := v . fileBlockReader . ( * archive15 ) ; ok { v . old = a . old } } if ! v . old { m := reNew . FindStringSubmatchIndex ( file ) if m == nil { v . old = true } else { lo = m [ 2 ] hi = m [ 3 ] if lo < 0 { lo = m [ 4 ] hi = m [ 5 ] } } } if v . old { m := reOld . FindStringSubmatchIndex ( file ) lo = m [ 2 ] hi = m [ 3 ] } n , err := strconv . Atoi ( file [ lo : hi ] ) if err != nil { n = 0 } else { n ++ } vol := fmt . Sprintf ( " " + fmt . Sprint ( hi - lo ) + " " , n ) v . name = dir + file [ : lo ] + vol + file [ hi : ] }
nextVolName updates name to the next filename in the archive.
nextVolName updates name to the next filename in the archive .