comp.lang.ada
 help / color / mirror / Atom feed
From: Anh Vo <anhvofrcaus@gmail.com>
Subject: Re: File_size on windows Ada 2005
Date: Fri, 05 Oct 2007 01:33:43 -0000
Date: 2007-10-05T01:33:43+00:00	[thread overview]
Message-ID: <1191548023.431469.101720@g4g2000hsf.googlegroups.com> (raw)
In-Reply-To: <1191546410.087526.327550@19g2000hsx.googlegroups.com>

On Oct 4, 6:06 pm, Adam Beneschan <a...@irvine.com> wrote:
> On Oct 4, 11:09 am, Anh Vo <anhvofrc...@gmail.com> wrote:
>
> > On Oct 3, 8:10 pm, "ME" <abcd...@nonodock.net> 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





  reply	other threads:[~2007-10-05  1:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <13g8me47tunfb77@corp.supernews.com>
2007-10-04 18:09 ` File_size on windows Ada 2005 Anh Vo
2007-10-05  1:06   ` Adam Beneschan
2007-10-05  1:33     ` Anh Vo [this message]
2007-10-04 20:37 ` anon
2007-10-05  4:51   ` ME
2007-10-05 14:29     ` anon
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox