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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,ccbf9deb2b62d073 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!g4g2000hsf.googlegroups.com!not-for-mail From: Anh Vo Newsgroups: comp.lang.ada Subject: Re: File_size on windows Ada 2005 Date: Fri, 05 Oct 2007 01:33:43 -0000 Organization: http://groups.google.com Message-ID: <1191548023.431469.101720@g4g2000hsf.googlegroups.com> References: <13g8me47tunfb77@corp.supernews.com> <1191521369.369419.29230@o80g2000hse.googlegroups.com> <1191546410.087526.327550@19g2000hsx.googlegroups.com> NNTP-Posting-Host: 209.225.224.254 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: posting.google.com 1191548023 32462 127.0.0.1 (5 Oct 2007 01:33:43 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 5 Oct 2007 01:33:43 +0000 (UTC) In-Reply-To: <1191546410.087526.327550@19g2000hsx.googlegroups.com> User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322; InfoPath.1),gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: g4g2000hsf.googlegroups.com; posting-host=209.225.224.254; posting-account=ps2QrAMAAAA6_jCuRt2JEIpn5Otqf_w0 Xref: g2news2.google.com comp.lang.ada:2308 Date: 2007-10-05T01:33:43+00:00 List-Id: On Oct 4, 6:06 pm, Adam Beneschan wrote: > On Oct 4, 11:09 am, Anh Vo wrote: > > > On Oct 3, 8:10 pm, "ME" wrote: > > > > Does File_size work on directories? What does it return in windows? > > > Use the function Directories.Size (String) return > > Directories.File_Size as shown in function specification below > > > function Size (Name : String) return File_Size; > > This doesn't necessarily work on directories, though, even though it's > in the Directories package. The description of the Size function is: > > # Returns the size of the external file represented by Name. The size > of an > # external file is the number of stream elements contained in the > file. If the > # external file is not an ordinary file, the result is implementation- > defined. > > and a directory is certainly not an ordinary file. So if you give it > a directory name as the Name, it could raise an exception (possibly > Name_Error, but not necessarily), or it could return a result that > means something implementation-defined, or it could return meaningless > garbage. Oops! you are right. It raised Name_Error when I tested it. It would be nice if it returns some number such as 512 when issuing command line ls -l on Linux. AV