Code: Select all
ForEach List()
...
Next
Code: Select all
ForEach List()
...
Next
Code: Select all
Procedure .i open_output(Filename$, ArchiveName$)
Protected szDestination.s, subdir_count.i, i.i
ReplaceString(Filename$, "?", "_", #PB_String_InPlace)
ReplaceString(Filename$, "|", "_", #PB_String_InPlace)
szDestination.s = GetPathPart(ArchiveName$) + GetFilePart(ArchiveName$, #PB_FileSystem_NoExtension) + "/"
CreateDirectory(szDestination)
If FindString(Filename$, "/")
subdir_count = CountString(Filename$, "/")
For i = 1 To subdir_count
szDestination + StringField(Filename$, i, "/") + "/"
CreateDirectory(szDestination)
Next i
EndIf
ProcedureReturn CreateFile(#PB_Any, szDestination + GetFilePart(Filename$))
EndProcedure
Yes, that's right. I didn't have that on my radar at all. I did the routine this morning before I went to bed. But it's not even final yet.infratec wrote: ↑Mon Feb 13, 2023 8:27 pm You know that you haveThis is much easier than RestList() ... NextElement()Code: Select all
ForEach List() ... Next
Yes. I already thought so. The Amiga file system allows characters that do not work under Windows.infratec wrote: ↑Mon Feb 13, 2023 9:28 pm To extract this file:
https://files.scene.org/get/demos/group ... s-vrtg.lzx
I needed to do:else some files were not extracted.Code: Select all
Procedure .i open_output(Filename$, ArchiveName$) Protected szDestination.s, subdir_count.i, i.i ReplaceString(Filename$, "?", "_", #PB_String_InPlace) ReplaceString(Filename$, "|", "_", #PB_String_InPlace) szDestination.s = GetPathPart(ArchiveName$) + GetFilePart(ArchiveName$, #PB_FileSystem_NoExtension) + "/" CreateDirectory(szDestination) If FindString(Filename$, "/") subdir_count = CountString(Filename$, "/") For i = 1 To subdir_count szDestination + StringField(Filename$, i, "/") + "/" CreateDirectory(szDestination) Next i EndIf ProcedureReturn CreateFile(#PB_Any, szDestination + GetFilePart(Filename$)) EndProcedure
Code: Select all
Procedure .i Process_DataContent(*UnLZX.LZX_ARCHIVE )
With *UnLZX
ResetList(\FileData() )
ResetList(\ListData() )
While NextElement( \FileData() )
If ( Len( \FileData()\File) > 0 )
AddElement( \ListData() )
\ListData()\PathFile = \FileData()\File
\ListData()\Position = ListIndex( \FileData() )
EndIf
Wend
ResetList(\FileData() )
ResetList(\ListData() )
EndWith
ProcedureReturn ListSize(*UnLZX\ListData())
EndProcedure
Code: Select all
Procedure .i Examine_Archive( *UnLZX.LZX_ARCHIVE )
Protected.i Result
If ( *UnLZX > 0 )
Result = Process_DataContent(*UnLZX )
Debug_View_Archiv(*UnLZX)
EndIf
ProcedureReturn Result
EndProcedure