Uncompressing duf files
meipe
Posts: 101
I am working on a script that opens a duf file, edits its content as a string, then saves it again as a new duf.
It works... except when the source file is compressed. Is there a way to uncompress the input file?
//some stuff before to choose our input file var ifp = DzFile( ifn ); //In ifp.open( DzFile.ReadOnly | DzFile.Translate ); var ofp = DzFile( ofn ); //Out ofp.open( DzFile.WriteOnly | DzFile.Translate | DzFile.Truncate ); for( var ln = ifp.readLine(); !ifp.eof(); ln = ifp.readLine() ) { ln2=ln.replace("a","b"); ofp.writeLine( ln2 ); ifp.close(); ofp.close();
Post edited by Richard Haseltine on
Comments
Use DzGZFile instead of DzFile http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/gzfile_dz
Perfect thank you! Interesting that DzGZFile opens both compressed and uncompressed files.