splitter: implemented filecount .
This commit is contained in:
parent
a429b71282
commit
56969ca5b3
1 changed files with 24 additions and 14 deletions
|
@ -1,19 +1,29 @@
|
||||||
|
|
||||||
|
require 'xtmfile/header'
|
||||||
|
|
||||||
module XtmFile
|
module XtmFile
|
||||||
class Splitter
|
class Splitter
|
||||||
attr_reader :parts, :parts_size
|
attr_reader :parts, :parts_size
|
||||||
def initialize input_filename
|
def initialize input_filename
|
||||||
@input_filename = input_filename
|
@input_filename = input_filename
|
||||||
@parts = 0
|
|
||||||
@parts_size = 0
|
|
||||||
end
|
|
||||||
|
|
||||||
def parts= count
|
# create and initialize header
|
||||||
end
|
@header = Header.new
|
||||||
|
@header.filename_str = @input_filename
|
||||||
|
end
|
||||||
|
|
||||||
def parts_size= size
|
def parts= count
|
||||||
end
|
@header.filecount = count
|
||||||
|
end
|
||||||
|
|
||||||
def start
|
def parts_size= size
|
||||||
end
|
count = @header.filesize / size
|
||||||
end
|
remain = @header.filesize % size
|
||||||
|
count += 1 if remain > 0
|
||||||
|
@header.filecount = count
|
||||||
|
end
|
||||||
|
|
||||||
|
def start
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue