At 13:11 +0100 02/01/2002, Tony �str�m wrote:

>I save a textfile with my suffix .ecd in Dir.8.0 (fileio).
>On Mac it works fine = filename.ecd but
>on Win it also apply .txt  = filename.ecd.txt
>WHY?????

For some reason Director assumes that a path passed along in FileIO 
on Windows, if an extension is not explicitly supplied, should have a 
.txt appended. It's frustrating.

To be fair I believe this is an artifact of FIleIO itself, which was 
released in its current incarnation with Director version 5. AFAIK it 
has not been significantly altered since then.

Here's the fix. Assume the filename you want to use is stored in the 
variabe sMyPath. Add these lines of code just before you actually 
create and save the file. (Naturally you will want to substitute 
sMyPath for whatever variable you are using.)

   sDelimSave = the itemDelimiter
   the itemDelimiter = "."
   if the last item of sMyPath = "TXT" then
     delete the last item of sMyPath
   end if
   the itemDelimiter = sDelimSave

You can let this run on Mac too. It won't have any effect there.

-- 

              Warren Ockrassa | http://www.nightwares.com/
  Director help | Free files | Sample chapters | Freelance | Consulting
        Author | Director 8.5 Shockwave Studio: A Beginner's Guide
                    Published by Osborne/McGraw-Hill
          http://www.osborne.com/indexes/beginners_guides.shtml
[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!]

Reply via email to