It is currently Thu Sep 19, 2019 3:53 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Packer lib path seperator error in AddPackFile
PostPosted: Wed Sep 11, 2019 1:21 pm 
Offline
User
User

Joined: Wed Jan 31, 2018 4:03 pm
Posts: 11
If a file is added to a ZIP pack and the PackedFilename includes a path, like "test\myfile.txt", the filename later returned by PackEntryName() always contains a "/" as path seperator, not a "\" as required by windows.
I did so far only check ZIP format and Windows.
Purebasic Version 5.70LTS 64bit Windows

Code:
; This demo shows a packer lib bug if run under MS windows7 professional SP1
; a file with a path name in the PackedFilename is added : test\PureBasic.chm
; this file IS indeed added in a subfolder "test" in the zip file.
; BUT if this pack is later examined with ExaminePack(), the PackEntryName() returns a "/" as path seperator, even if all operations are done under windows where the path seperator is "\"
;
UseZipPacker()
Debug "compiler home : " + #PB_Compiler_Home
 packer = CreatePack(#PB_Any,"c:\test.zip",#PB_PackerPlugin_Zip)
 If packer
   AddPackFile(packer,#PB_Compiler_Home+"PureBasic.chm","test\PureBasic.chm")
   ClosePack(packer)
 EndIf
 If OpenPack(0,"c:\test.zip",#PB_PackerPlugin_Zip)
   ExaminePack(0)
   While NextPackEntry(0)
     Debug "Name: " + PackEntryName(0) + ", Size: " + PackEntrySize(0)
   Wend   
   ClosePack(0)
 EndIf


Top
 Profile  
Reply with quote  
 Post subject: Re: Packer lib path seperator error in AddPackFile
PostPosted: Wed Sep 11, 2019 5:23 pm 
Offline
Always Here
Always Here
User avatar

Joined: Thu Jun 24, 2004 2:44 pm
Posts: 5755
Location: Berlin - Germany
Not a bug. Use always slash and not backslash, on all OS!

_________________
PureBasic 5.71 | SpiderBasic 2.21 | Windows 10 Pro (x64) | Linux Mint 19.2 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye