Re: Zip file with password...?

2018-04-10 Thread Koen Van Hooreweghe via 4D_Tech
Hi Robert,

I had to investigate a similar request a while ago. As far as I know, ditto can 
only extract password encrypted zip archives, not create them.

But you might try with the zip command (as Chip also mentioned):

$command:="zip -r --encrypt --password "+$mypassword+" "+$ZipFile+$SourceFile

Beware the source en destination paths are the other way around as in the ditto 
command. Add double quotes where needed.

HTH
Koen

> Op 9 apr. 2018, om 23:32 heeft Robert ListMail via 4D_Tech 
> <4d_tech@lists.4d.com> het volgende geschreven:
> 
> LAUNCH EXTERNAL PROCESS("ditto -c -k -X --norsrc "+Char(Double 
> quote)+$SourceFile+Char(Double quote)+" "+Char(Double 
> quote)+$ZipFile+Char(Double quote);$in;$out;$err)




Compass bvba
Koen Van Hooreweghe
Kloosterstraat 65
9910 Knesselare
Belgium
tel +32 495 511.653

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Zip file with password...?

2018-04-09 Thread Robert ListMail via 4D_Tech
Right, I looked at that before posting. The docs talk about using the password 
only in the context of “extracting”. I will try to use that option although not 
sure where the password would be passed.

Thanks,

Robert

> On Apr 9, 2018, at 4:39 PM, Keisuke Miyako via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> you might find some hints in the "ditto" documentation
> 
> https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man1/ditto.1.html
>  
> 

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Zip file with password...?

2018-04-09 Thread Chip Scheide via 4D_Tech
looks like my previous post was incorrect.

There is a --password option where you can specify the password to be 
used


On Mon, 9 Apr 2018 16:32:29 -0500, Robert ListMail via 4D_Tech wrote:
> I have a v13-based Mac application that’s been happily zipping files 
> for an email attachment for years. Now, I’d like to add a password 
> (preferably) zero-length to prevent a certain mail server from trying 
> to read this file. The current code (that I didn’t write) and that I 
> believe is creating the zipped file is:
> 
> $SourceFile:=Replace string($FilePath;":";"/")
> $SourceFile:="/Volumes/"+$SourceFile
> 
$SourceFile:=Substring($SourceFile;Position("/";$SourceFile);Length($SourceFile)-(Position("/";$SourceFile)-1))
> $ZipFile:=$SourceFile
> $ZipFile:=Substring($ZipFile;1;Length($ZipFile)-3)+"zip"
> LAUNCH EXTERNAL PROCESS("ditto -c -k -X --norsrc "+Char(Double 
> quote)+$SourceFile+Char(Double quote)+" "+Char(Double 
> quote)+$ZipFile+Char(Double quote);$in;$out;$err)
> $ZipFile:=Replace string($FilePath;".xls";".zip")
> 
> How do you typically handle creating zipped files, intended to be 
> emailed, on Mac-based system?  How would you add the encryption or 
> password protection to such a file?
> 
> Thanks,
> 
> Robert
> 
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
---
Gas is for washing parts
Alcohol is for drinkin'
Nitromethane is for racing 
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Zip file with password...?

2018-04-09 Thread Chip Scheide via 4D_Tech
I would suggest trying ($in is supposed to be parameters..
--encrypt requires a password (entered at terminal)
play around, the separating character may not be a space, but rather a 
line feed, or return
or it may not work at all since --encrypt wants a password to be 
entered and confirmed

$In:= +" "+
LEP(zip --encrypt  ;$in;$out;$Err)


On Mon, 9 Apr 2018 16:32:29 -0500, Robert ListMail via 4D_Tech wrote:
> I have a v13-based Mac application that’s been happily zipping files 
> for an email attachment for years. Now, I’d like to add a password 
> (preferably) zero-length to prevent a certain mail server from trying 
> to read this file. The current code (that I didn’t write) and that I 
> believe is creating the zipped file is:
> 
> $SourceFile:=Replace string($FilePath;":";"/")
> $SourceFile:="/Volumes/"+$SourceFile
> 
$SourceFile:=Substring($SourceFile;Position("/";$SourceFile);Length($SourceFile)-(Position("/";$SourceFile)-1))
> $ZipFile:=$SourceFile
> $ZipFile:=Substring($ZipFile;1;Length($ZipFile)-3)+"zip"
> LAUNCH EXTERNAL PROCESS("ditto -c -k -X --norsrc "+Char(Double 
> quote)+$SourceFile+Char(Double quote)+" "+Char(Double 
> quote)+$ZipFile+Char(Double quote);$in;$out;$err)
> $ZipFile:=Replace string($FilePath;".xls";".zip")
> 
> How do you typically handle creating zipped files, intended to be 
> emailed, on Mac-based system?  How would you add the encryption or 
> password protection to such a file?
> 
> Thanks,
> 
> Robert
> 
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
---
Gas is for washing parts
Alcohol is for drinkin'
Nitromethane is for racing 
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Zip file with password...?

2018-04-09 Thread Keisuke Miyako via 4D_Tech
you might find some hints in the "ditto" documentation

https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man1/ditto.1.html

2018/04/09 17:32、Robert ListMail via 4D_Tech <4d_tech@lists.4d.com> のメール:
LAUNCH EXTERNAL PROCESS("ditto -c -k -X --norsrc "+Char(Double 
quote)+$SourceFile+Char(Double quote)+" "+Char(Double 
quote)+$ZipFile+Char(Double quote);$in;$out;$err)



**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Zip file with password...?

2018-04-09 Thread Robert ListMail via 4D_Tech
I have a v13-based Mac application that’s been happily zipping files for an 
email attachment for years. Now, I’d like to add a password (preferably) 
zero-length to prevent a certain mail server from trying to read this file. The 
current code (that I didn’t write) and that I believe is creating the zipped 
file is:

$SourceFile:=Replace string($FilePath;":";"/")
$SourceFile:="/Volumes/"+$SourceFile
$SourceFile:=Substring($SourceFile;Position("/";$SourceFile);Length($SourceFile)-(Position("/";$SourceFile)-1))
$ZipFile:=$SourceFile
$ZipFile:=Substring($ZipFile;1;Length($ZipFile)-3)+"zip"
LAUNCH EXTERNAL PROCESS("ditto -c -k -X --norsrc "+Char(Double 
quote)+$SourceFile+Char(Double quote)+" "+Char(Double 
quote)+$ZipFile+Char(Double quote);$in;$out;$err)
$ZipFile:=Replace string($FilePath;".xls";".zip")

How do you typically handle creating zipped files, intended to be emailed, on 
Mac-based system?  How would you add the encryption or password protection to 
such a file?

Thanks,

Robert

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**