PureZIP library : ZIP / UNZIP files

All PureFORM, JaPBe, Libs and useful code maintained by gnozal

Moderator: gnozal

String
New User
New User
Posts: 7
Joined: Sat May 26, 2007 9:48 pm

Post by String »

I always get the same result

My system: German
Windows XP
PureBasic v4.02
PureZIP beta of this (April 16th, 2007) (download above)

Test code: of gnozal
My result:

Code: Select all

C:\TEMP\111111111111111\222222222222222\33333333333333333\444444444444444\555555555555\666666666\777777777777777777\TEMP\111111111111111\222222222222222\33333333333333333\444444444444444\555555555555\666666666\ 777
The PureFileMaster of al90 German forum cannot work with long path names, either.
http://www.purebasic.fr/german/viewtopi ... filemaster
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

String wrote:I always get the same result
My system: German
Windows XP
PureBasic v4.02
PureZIP beta of this (April 16th, 2007) (download above)
So you say my code doesn't work for you on your system ?
It works here (NT4 sp6) ... ! Are you using FAT or NTFS ?

Note that :
- I am using MakeSureDirectoryPathExists_() to create the output path and CreateFile()/WriteData()/CloseFile() to create the file
- The code works (here)
so I don't see any obvious explanation for your problem.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Tranquil
Addict
Addict
Posts: 952
Joined: Mon Apr 28, 2003 2:22 pm
Location: Europe

Post by Tranquil »

About MakeSureDirectoryPathExists_():

I read a huge discussion in the german PB board about this command that it does not seems to work very well. I also had problems using this command and could not get it work 100% correctly.
Tranquil
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Tranquil wrote:About MakeSureDirectoryPathExists_():
I read a huge discussion in the german PB board about this command that it does not seems to work very well. I also had problems using this command and could not get it work 100% correctly.
So it works with WinNT4 but not with XP ?!
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Tranquil
Addict
Addict
Posts: 952
Joined: Mon Apr 28, 2003 2:22 pm
Location: Europe

Post by Tranquil »

I only tried it at a XP system and could not get it work. For now I use a Procedure which do the trick. This is what I use and which seems to work just fine. (a snipped found in the german forum)

Code: Select all

Procedure.l MakeSureDirectoryPathExistsEX(Dir$)

Protected i, b$, c$
If Right(Dir$,1)<>"\" : Dir$+"\" : EndIf

If Mid(Dir$,2,2)=":\" And FileSize(Dir$)=-1
  c$=Left(Dir$,3)
  For i=4 To Len(Dir$)
    b$=Mid(Dir$,i,1)
    c$+b$
    If b$="\"
      If CreateDirectory(c$)=0
        ProcedureReturn #False
      EndIf
    EndIf
  Next
EndIf 
ProcedureReturn #True
EndProcedure
but regarding to the Bug-Reports section and the FileSize() Problem with networkpaths this procedure may also have problems with UNC-Paths till this one is fixed.
Tranquil
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

MakeSureDirectoryPathExists_() seems to work fine on my machine, but then I'm only using it on local devices, no fancy network stuff or anything. The CodeSync function of CodeCaddy uses it intensively.
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

> MakeSureDirectoryPathExists_()
PSDK wrote:Requires DbgHelp.dll on Windows NT 4.0 and Windows Me/98/95.
The installation of the dll is optional by setup windows (comes with a optional program)
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

ts-soft wrote:> MakeSureDirectoryPathExists_()
PSDK wrote:Requires DbgHelp.dll on Windows NT 4.0 and Windows Me/98/95.
The installation of the dll is optional by setup windows (comes with a optional program)
The older Win32.hlp says it comes with IMAGEHLP.DLL ... Anyway, I found it so far on any system I checked.
string wrote:I always get the same result
Did you try to create a long path (> 200) with MakeSureDirectoryPathExists_() on your system (just to be sure this is the issue) ?
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
String
New User
New User
Posts: 7
Joined: Sat May 26, 2007 9:48 pm

Post by String »

Hello gnozal

I use NTFS

MakeSureDirectoryPathExists
work well

I have looked For help in the German forum.
http://www.purebasic.fr/german/viewtopi ... &start=140

Code: Select all

For a = 1 To 4
  For b = 1 To 59
    File1.s = File1.s  +"a"
  Next b
  File1.s = File1.s  +"\"
Next a
File1.s = "c:\Temp\" + File1.s + "My.txt"

Debug Str(Len(File1)) + "  sign"
Debug  File1

MakeSureDirectoryPathExists_(@File1)
If OpenFile(1,File1)
  WriteString(1,"File1 OK")
  CloseFile(1)
EndIf 
Debug "END"
User avatar
AL90
Enthusiast
Enthusiast
Posts: 217
Joined: Fri Sep 16, 2005 7:47 pm
Location: Germany
Contact:

Post by AL90 »

Now I have test the BETA lib in PureFileMaster. (No changes on my code. Only zip-Lib replaced)
And it works now fine.

@gnozal

can I use this BETA lib for my next PFM release, or it is better to wait for your
official new Final-Release ? (1.80 ??) What do you recommend ?
I can't say if it is stable in all operations because I tested only the Long-
Filenames.

BTW:
File Attributes still not added in the new BETA.
String
New User
New User
Posts: 7
Joined: Sat May 26, 2007 9:48 pm

Post by String »

Hello gnozal
Sorry
The beta is OK!
Something always went wrongly at the download.
Sorry :oops:
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

If the beta lib is ok, I will update all the libraries.
No problem using the beta. The final will have the same code.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Update (both libs)

Changes :
- fixed a problem with very long path names
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

AL90 wrote:BTW:
File Attributes still not added in the new BETA.
What files attributes ? There are no ZLIB functions to handle file attributes iirc.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
User avatar
AL90
Enthusiast
Enthusiast
Posts: 217
Joined: Fri Sep 16, 2005 7:47 pm
Location: Germany
Contact:

Post by AL90 »

gnozal wrote:What files attributes ? There are no ZLIB functions to handle file attributes iirc.
Sorry I don't know that it is not possible. I have it tested with TC.
(An ReadOnly file packed and with PFM extracted, and the flag is hold)
If I pack it with pureZip the flag will lost. So are flags readable but not
writeable in archive. Thats is what I mean. It is sad that this is not
supported from ZLib.

Thanks for Help.
Post Reply