Hey WP,
I've been using forward slashes in Windows for zipper usage in fpspreadsheet all the time, and there have never been any reports of unreadable files in Linux. Also, the attached project results in a valid zip in windows and Linux.
Well, if you invert those slashes,
TZipper will zip it,
TUnzipper will unzip it and it's even a valid zip file.
The problem is that if you invert those slashes the Unzipping in Windows will have
ONE behaviour and the Unzipping in Linux will have
ANOTHER, as I've demonstrated MANY times in the posts above.
The fact is that there isn't any error or warning or anything when you feed this:
'subdir/a.txt' OR this:
'subdir\a.txt' to
AddFileEntry() and this a problem for any novice programmer that isn't aware that the ZIP standard is to use forward slashes.
IOW, if you feed this
'subdir/a.txt' to
AddFileEntry() you get:
- Windows: A file a.txt inside a folder subdir.
- Linux: A file a.txt inside a folder subdir.
BUT, if you feed this
'subdir\a.txt' to
AddFileEntry() you get:
- Windows: A file a.txt inside a folder subdir.
- Linux: A file called subdir\a.txt. And YES, that's a valid Unix filename.
Internally, the Entries class has 2 properties. One is called
Filename and the other is
Archivename, among other copies due to UTF8.
In my view,
Filename can contain the platform specific slash AS LONG AS the
Archivename will ALWAYS be platform independent and ZIP compliant by ALWAYS having the forward slash.
And I've demonstrated well enough, that that's not the case.
But that's all moot because a cross-platform component should behave the same on different platforms NO MATTER what the user inputs in terms of files, right?
Or am I missing something here, WP?
Cheers,
Guss