> I've been using the following piece of code to unzip a password-protected
> zip on to the user's machine. Works wonderfully on Windows 98 and NT but
> not Windows 2000. Does anyone have any idea why? Also, the code doesn't
> work for the Mac either. Does anyone know what I can do to make it work for
> the Mac? Any insights will be appreciated. Thank you.
>
> if objectP(myFileIO) then set myFileIO = 0
> - --Delete the instance if it already exists
> myFileIO = new(xtra "FileIO")
> - --Create FileIO object
> put chars(string(gLogo),1,length(string(gLogo))-3) & "eps" into
> resultfile
> put myFileIO.displaySave("Save As", string (resultfile)) into
> extractPath -- display the "Open" dialog
>
> if (extractPath = "") = false then
> - -- execute only if diferent from blank.
> put "-s" & gLogoPass & " " & DirectorDir & "logo\" & gLogo &
> " " & chars(extractPath,1,length(extractPath) - length(resultfile)) into
> openexec
> open openexec with "pkunzip"
> end if
I'm a bit surprised that the code works anywhere, since you don't supply a
full pathname to pkunzip.
A few points. One, you can use && instead of & " " & (&& concatenates with a
space inserted). Two, you need to supply full pathnames to both the file and
the app when using lingo's "open" command. When working cross-platform, this
means also getting the path delimeters correct ("\", as in your code, for
windows, and ":" for mac).
I would recommend Buddy for opening the file (since you would use only 1
function, it would be free). baOpenFile() does not require a full pathname
to the app - it will open a file in its associated app. But, you then need a
correct pathname to the file.
I usually store the path delimeter on startmovie (actually, I usually store
it as a property of an object which handles any operations that need a
pathname, but that's an aside), and then use it whenever the need arises.
Using a global, you would do something like this:
global gPathDelim
on startMovie
gPathDelim = (the moviepath).char[(the moviepath).char.count]
end
Then, when constructing your paths, just insert gPathDelim whenever you dig
into a directory. For example, modifying your code:
openexec = "-s" & gLogoPass && DirectorDir & "logo" & gPathDelim & gLogo &&
chars(extractPath,1,length(extractPath) - length(resultfile))
HTH,
Kurt
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/lingo-l.cgi To post messages to the list,
email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo. Thanks!]