51 lines
1.3 KiB
Plaintext
Executable File
51 lines
1.3 KiB
Plaintext
Executable File
--
|
|
-- File:: extract_rpf.rbs
|
|
-- Description:: Extract an RPF file.
|
|
--
|
|
-- Author:: David Muir <david.muir@rockstarnorth.com>
|
|
-- Date:: 12 July 2011
|
|
--
|
|
|
|
source = get_param("input")
|
|
outputFolder = get_param("output")
|
|
|
|
outputExt = string.lower(get_extension_from_path(source))
|
|
|
|
-----------------------------------------------------------------------------
|
|
-- Functions
|
|
-----------------------------------------------------------------------------
|
|
|
|
function extract_recursive( path, outputDir )
|
|
|
|
local files = find_files( path .. "\\" .. "*.*" )
|
|
for key, value in files do
|
|
|
|
local input = path .. "\\" .. value
|
|
local output = outputDir .. "\\" .. value
|
|
|
|
print( input .. " ==> " .. output )
|
|
create_leadingpath( output )
|
|
copy_file( input, output )
|
|
end
|
|
|
|
local dirs = find_dirs( path )
|
|
for key, value in dirs do
|
|
|
|
local dir = path .. "\\" .. value
|
|
local output = outputDir .. "\\" .. value
|
|
|
|
create_leadingpath( output )
|
|
extract_recursive( dir, output )
|
|
end
|
|
end
|
|
|
|
-----------------------------------------------------------------------------
|
|
-- Entry-Point
|
|
-----------------------------------------------------------------------------
|
|
|
|
mount_pack(source, "image:/")
|
|
extract_recursive( "image:/", outputFolder )
|
|
unmount_pack(source)
|
|
|
|
-- extractimage.rbs
|