Re: uuencode/uudecode

2010-09-30 Thread Alex Tweedly


Sorry about the delay - I started this interesting exercise, but got 
distracted .


Here's a simple script that handles uuencoding a file. It's been 
moderately, but not thoroughly, tested.



on mouseUp
   answer file Select a file
   if it is empty then exit mouseUp
   put URL (binfile:  it) into tOriginal
   -- put Cat into tOriginal
   put uuencode(tOriginal, 000, text) into tEncoded
   put tEncoded after field fLog
   put CR  the number of chars in tOriginal  the number of chars in 
tEncoded after field fLog

end mouseUp

function uuencode pData, pPermission, pName
   put 1 into tBase
   put begin  pPermission  pName  CR into tOutput

   put the number of chars in pData into tLen
   put numToChar(0)  numToChar(0)  numToChar(0) after pData

   put empty into tLine
   repeat until tBase  tLen-2   -- i.e. all full words before the padding
  put charToNum(byte tBase of pData) * 256 * 256 into t
  add charToNum(byte tBase+1 of pData) * 256 to t
  add charToNum(byte tBase+2 of pData) to t

  put numToChar((t mod 64)+32) into t4
  put t div 64 into t
  put numToChar((t mod 64)+32) into t3
  put t div 64 into t
  put numToChar((t mod 64)+32) into t2
  put t div 64 into t
  put numToChar(t+32)  t2  t3  t4 after tLine

  if the number of chars in tLine = 60 then
 put numToChar(the number of chars in tLine * 3 / 4 + 32)  
tLine  CR after tOutput

 put empty into tLine
  end if
  add 3 to tBase
   end repeat
   if tLine is not empty then
  put numToChar(the number of chars in tLine * 3 / 4 + 32)  tLine 
 CR after tOutput

   end if
   put `  CR  end  CR after tOutput
   return tOutput
end uuencode



On 23/09/2010 19:56, Phil Davis wrote:

 Hi Matthias,

With LiveCode on Mac OS X you could use a shell() command and let the 
'uuencode' line command do the work. Not sure about Windows... there 
doesn't seem to be a direct way to uuencode a file - no 'uuencode' 
command, nor any way to do it using PowerShell (AFAIK). Do you feel 
like writing your own LC uu library? That should be doable.


More info about the uuencode spec:
http://en.wikipedia.org/wiki/Uuencoding
http://www.opengroup.org/onlinepubs/009695399/utilities/uuencode.html

Phil


On 9/23/10 7:42 AM, Matthias Rebbe wrote:

Hi,

how can i uuencode data with LiveCode?
Do i need 3rd party tools for that? i cannot find anything about it, 
when searching the dictionary for uuencode.




___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


uuencode/uudecode

2010-09-23 Thread Matthias Rebbe
Hi,

how can i uuencode data with LiveCode?
Do i need 3rd party tools for that? i cannot find anything about it, when 
searching the dictionary for uuencode.

Regards,

Matthias___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: uuencode/uudecode

2010-09-23 Thread Phil Davis

 Hi Matthias,

With LiveCode on Mac OS X you could use a shell() command and let the 'uuencode' 
line command do the work. Not sure about Windows... there doesn't seem to be a 
direct way to uuencode a file - no 'uuencode' command, nor any way to do it 
using PowerShell (AFAIK). Do you feel like writing your own LC uu library? That 
should be doable.


More info about the uuencode spec:
http://en.wikipedia.org/wiki/Uuencoding
http://www.opengroup.org/onlinepubs/009695399/utilities/uuencode.html

Phil


On 9/23/10 7:42 AM, Matthias Rebbe wrote:

Hi,

how can i uuencode data with LiveCode?
Do i need 3rd party tools for that? i cannot find anything about it, when 
searching the dictionary for uuencode.

Regards,

Matthias___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution



--
Phil Davis

PDS Labs
Professional Software Development
http://pdslabs.net

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution