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=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1149539ccb97b04c X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-09-14 09:21:03 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!newsfeeds.belnet.be!news.belnet.be!fr.usenet-edu.net!usenet-edu.net!enst!enst.fr!not-for-mail From: "Beard, Frank" Newsgroups: comp.lang.ada Subject: RE: Win32 filetype problem Date: Fri, 14 Sep 2001 12:19:41 -0400 Organization: ENST, France Sender: comp.lang.ada-admin@ada.eu.org Message-ID: Reply-To: comp.lang.ada@ada.eu.org NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: avanie.enst.fr 1000484462 48168 137.194.161.2 (14 Sep 2001 16:21:02 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Fri, 14 Sep 2001 16:21:02 +0000 (UTC) To: "'comp.lang.ada@ada.eu.org'" Return-Path: X-Mailer: Internet Mail Service (5.5.2448.0) Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.0.4 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: comp.lang.ada mail<->news gateway List-Unsubscribe: , List-Archive: Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org Xref: archiver1.google.com comp.lang.ada:13080 Date: 2001-09-14T12:19:41-04:00 The return statement should probably be: return Result /= 16#FFFF_FFFF# and then (Result and Win32.WinNT.FILE_ATTRIBUTE_DIRECTORY) /= 0; Get Pascal Obry's POSIX binding, which is a wrapper around the Win32 APIs, off of AdaPower and look at POSIX_Files.Is_File and POSIX_Files.Is_Directory. Even if you don't use the POSIX binding directly, it's a good source for seeing how to use the Window's API. Frank -----Original Message----- From: Martin Dowie [mailto:martin.dowie@nospam.baesystems.com] Sent: Friday, September 14, 2001 6:18 AM To: comp.lang.ada@ada.eu.org Subject: Re: Win32 filetype problem Martin Dowie wrote in message news:3ba1d1b9$1@pull.gecm.com... > System: WIntel NT, GNAT 3.13p [snip] > declare > function To_LPCSTR is > new Ada.Unchecked_Conversion (Source => System.Address, ^^^^^^^^^^^^^^ I'm an idiot, this should be Chars_Ptr... > Target => Win32.LPCSTR); > C_Filename : Chars_Ptr := New_String (Trimmed_Filename); > Result : Win32.DWORD; > begin > Result := Win32.Winbase.GetFileAttributesA (lpFileName => To_LPCSTR (S => > C_Filename'Address)); ^^^^^^^^ ...and then remove this! _______________________________________________ comp.lang.ada mailing list comp.lang.ada@ada.eu.org http://ada.eu.org/mailman/listinfo/comp.lang.ada