Re: Encode, Get ...
- To: mathgroup at smc.vnet.net
- Subject: [mg94624] Re: Encode, Get ...
- From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
- Date: Thu, 18 Dec 2008 07:20:01 -0500 (EST)
- Organization: The Open University, Milton Keynes, UK
- References: <gianu4$8fq$1@smc.vnet.net>
Ignacio Plazeta wrote:
> Surely I have miss out something; the following code
>
> SetDirectory[NotebookDirectory[]];
> myKey = "xyz";
> showFile = "1.bmp";
> hiddenFile = "2.bmp";
> Encode[showFile, hiddenFile, myKey]
> Get[hiddenFile, myKey]
>
> dosn't work the way I expected and returns, in the
> pink "Messages" windows:
>
> Syntax::sntxi: Incomplete expression; more input is needed.
> (line 1 of "2.bmp")
>
> Please, can you point the issue ?
I might be wrong but I do not think that function *Get[]* (shortcut
'<<') can handle graphic files. Often, Get[] is used to load a package
in memory: it reads a text file that contains code -- i.e. Mathematica
expressions -- and put the relevant definitions and symbols in memory,
ready to be used. For anything else, the command *Import[]* is used.
Now, I believe that the function *Encode[]* is designed solely to
obfuscated packages and notebooks. So the command *Get[]* can read a
file and decode it, but if at the end the result is not some Mathematica
expressions that can interpreted (for instance a bitmap graphic) the
command will failed.
SetDirectory[NotebookDirectory[]];
myKey = "xyz";
showFile = "1.bmp";
hiddenFile = "2.bmp";
Encode[showFile, hiddenFile, myKey]
FilePrint[hiddenFile]
(*!1N!*),lK
?kM<an%j?a/(w-xL6oP]TtZn|r^ig`jhf~=VR[QJA;v@H'jlh+OH!okT_&cmB66/c(HB*a
hLO^:5!7'hM\%NWi"jU yGH@.CNdO#C\$5a01IYzzZw]R+v%rR?CBXc/7Z;[,mu\{OFl)S
(* ... Very long output discarded ... *)
bB)xFT7N?iDSK&! oP1$d+fX%{iJ1-Mz/o7.F:quT!R5K*:d|;75n\'LOEos#%(+\5LVcC
<$K0?#9~Z*wB,K\^&pHi\>huR<\*7@ILN<F LhngWS"QCz),4&HOwe@-NM
Get[hiddenFile, myKey]
==>
Syntax::sntxi:
Incomplete expression; more input is needed. (line 1 of "2.bmp")
Get[showFile]
==>
Syntax::sntxi:
Incomplete expression; more input is needed. (line 1 of "1.bmp")
Regards,
-- Jean-Marc