From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: border1.nntp.dca3.giganews.com!border2.nntp.dca3.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!goblin3!goblin1!goblin.stu.neva.ru!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Calling a File for Encryption from outside of the Main Ada-95 Holding Folder. Date: Thu, 05 Sep 2013 06:39:23 +0100 Organization: A noiseless patient Spider Message-ID: References: <43c22997-0bb7-4ad6-879f-c5b2d8584f8a@googlegroups.com> <80934511-70fb-4f2b-ac4a-30ce5fd4a34c@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx05.eternal-september.org; posting-host="9fea184f47d12c052eb0a8a21bb4972e"; logging-data="7717"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18jWj6FEULDaBvR+n0MweyKaEHqC3QB1Qk=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (darwin) Cancel-Lock: sha1:fTBo2Ghk6LVLEXEgM4BxXa8uT4g= sha1:wOzK4vvqFwPDbbaRmqeVbdGdZnw= X-Original-Bytes: 3283 Xref: number.nntp.dca.giganews.com comp.lang.ada:183301 Date: 2013-09-05T06:39:23+01:00 List-Id: Austin Obyrne writes: > On Wednesday, September 4, 2013 9:37:30 PM UTC+1, Austin Obyrne wrote: > not directly?? what > Answering my own question - YES. > > It has to go through the AdaGIDE editor to be 'baptised' in Ada - this > is sine qua non - it was staring me in the face - clearly a file > created in MS Word is not acceptable to an Ada compiler - but the same > file is quite acceptable after is has passed through the adaGIDE which > is of course ADA and makes it compatible to the compiler - I have just > tried a small test file - it raised a 'constraint error' when I try to > encrypt it as a word doc but when I pass the same file through the > AdaGIDE editor before trying to encrypt it it works fine. A .doc or .docx file is not a text file; it contains all sorts of binary data. I created example.docx containing just the text "Hello, world.". It came out as nearly 4 kb and is in fact a zip archive: $ unzip -l example.docx Archive: example.docx Length Date Time Name -------- ---- ---- ---- 573 09-05-13 05:29 _rels/.rels 531 09-05-13 05:29 word/_rels/document.xml.rels 208 09-05-13 05:29 word/settings.xml 845 09-05-13 05:29 word/document.xml 1903 09-05-13 05:29 word/styles.xml 595 09-05-13 05:29 word/fontTable.xml 379 09-05-13 05:29 docProps/app.xml 476 09-05-13 05:29 docProps/core.xml 1118 09-05-13 05:29 [Content_Types].xml -------- ------- 6628 9 files Files like this shouldn't be opened with Ada.Text_IO. I bet that if you create your plaintext using Notepad (maybe even Wordpad) you wouldn't need to go through AdaGIDE to create a file that your program *can* open.