comp.lang.ada
 help / color / mirror / Atom feed
* Directories and files
@ 2002-02-19 21:23 Jos� Alberto
  2002-02-19 21:35 ` tmoran
  2002-02-20  2:21 ` sk
  0 siblings, 2 replies; 8+ messages in thread
From: Jos� Alberto @ 2002-02-19 21:23 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 238 bytes --]

Hello,

Could anybody tell me if there is a library or kind of program which tells
me the structure of a disk? I mean if there is a way to show the structure
of a folder (with subfolders and files).

Thanks in advance

Jos� Alberto





^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Directories and files
  2002-02-19 21:23 Directories and files Jos� Alberto
@ 2002-02-19 21:35 ` tmoran
  2002-02-20  8:14   ` Jos� Alberto
  2002-02-20  2:21 ` sk
  1 sibling, 1 reply; 8+ messages in thread
From: tmoran @ 2002-02-19 21:35 UTC (permalink / raw)


>Could anybody tell me if there is a library or kind of program which tells
>me the structure of a disk? I mean if there is a way to show the structure
>of a folder (with subfolders and files).
  Could you be more specific about what you want?  Under DOS or Windows
command line, you can use "tree foldername" to display the subfolders.
I have a program that displays the tree showing sizes of files & folders.
There are libraries that let your program step through a directory
and its subdirectories.  There are also platforms which don't have folders,
or even disks!



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Directories and files
  2002-02-19 21:23 Directories and files Jos� Alberto
  2002-02-19 21:35 ` tmoran
@ 2002-02-20  2:21 ` sk
  1 sibling, 0 replies; 8+ messages in thread
From: sk @ 2002-02-20  2:21 UTC (permalink / raw)


Hi, 

If you are using Gnat, look at Gnat.Directory_Operations.

This package provides the necessary primitives to traverse
a directory and change directories from within code.

If you need to detect that a file within the directory is
a sub-directory, use the function "Is_Directory" from
Gnat.Os_Lib.

For more detailed file information bind to the OS code of
your choice. On linux for example, I bound to all the 
necessary functions to be able to "stat" from within an Ada 
procedure which enables me to ignore sockets etc.


Pseudo-code :

GDOP renames Gnat.Directory_Operations;

Store Directory name of interest in a queue

loop

   Is the directory name queue empty ?
   YES : Exit loop
   NO  : 
       Get the Directory name and GDOP.Open it.

       while GDOP.Read (... opened directory) /= no more files

           Do what you want with the file name.

           Is the file name a directory ?
           YES : Add the name to the directory name queue.
           NO  : No Action

       end loop;

       GDOP.Close ( ... opened directory).       

end loop;

-------------------------------------
-- Merge vertically for real address
-------------------------------------
s n p @ t . o
 k i e k c c m
-------------------------------------



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Directories and files
  2002-02-19 21:35 ` tmoran
@ 2002-02-20  8:14   ` Jos� Alberto
  2002-02-20 17:54     ` Jos� Alberto
  0 siblings, 1 reply; 8+ messages in thread
From: Jos� Alberto @ 2002-02-20  8:14 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 792 bytes --]

It is just under DOS. I need to show folders, files and sizes.

Thans in advance

Jos� Alberto

<tmoran@acm.org> escribi� en el mensaje
news:uyzc8.1443$HO7.1345711167@newssvr21.news.prodigy.com...
> >Could anybody tell me if there is a library or kind of program which
tells
> >me the structure of a disk? I mean if there is a way to show the
structure
> >of a folder (with subfolders and files).
>   Could you be more specific about what you want?  Under DOS or Windows
> command line, you can use "tree foldername" to display the subfolders.
> I have a program that displays the tree showing sizes of files & folders.
> There are libraries that let your program step through a directory
> and its subdirectories.  There are also platforms which don't have
folders,
> or even disks!





^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Directories and files
  2002-02-20  8:14   ` Jos� Alberto
@ 2002-02-20 17:54     ` Jos� Alberto
  2002-02-21  8:10       ` tmoran
  0 siblings, 1 reply; 8+ messages in thread
From: Jos� Alberto @ 2002-02-20 17:54 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1144 bytes --]

As I haven't clear enought I must point that I need to make a program in ADA
which shows trees, files, sizes, etc. If anybody knows a library in ADA
please tell me!!!

Thanks in advance

Jos� Alberto

"Jos� Alberto" <HIGHLAND@santandersupernet.com> escribi� en el mensaje
news:a4vlt9$kb9$1@news.ya.com...
> It is just under DOS. I need to show folders, files and sizes.
>
> Thans in advance
>
> Jos� Alberto
>
> <tmoran@acm.org> escribi� en el mensaje
> news:uyzc8.1443$HO7.1345711167@newssvr21.news.prodigy.com...
> > >Could anybody tell me if there is a library or kind of program which
> tells
> > >me the structure of a disk? I mean if there is a way to show the
> structure
> > >of a folder (with subfolders and files).
> >   Could you be more specific about what you want?  Under DOS or Windows
> > command line, you can use "tree foldername" to display the subfolders.
> > I have a program that displays the tree showing sizes of files &
folders.
> > There are libraries that let your program step through a directory
> > and its subdirectories.  There are also platforms which don't have
> folders,
> > or even disks!
>
>





^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Directories and files
       [not found] <mailman.1014237242.7594.comp.lang.ada@ada.eu.org>
@ 2002-02-21  7:19 ` Jos� Alberto
  0 siblings, 0 replies; 8+ messages in thread
From: Jos� Alberto @ 2002-02-21  7:19 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 736 bytes --]

It is not for homework, I'm just writting a program for fun. If you want a
certify I can send you a declaration signed by me and my lawyer :-)

See You Soon!

Jos� Alberto

"Gautier Write-only-address" <gautier_niouzes@hotmail.com> escribi� en el
mensaje news:mailman.1014237242.7594.comp.lang.ada@ada.eu.org...
> >As I haven't clear enought I must point that I need to make
> >a program in ADA which shows trees, files, sizes, etc.
> >If anybody knows a library in ADA please tell me!!!
>
> Do you certify certify on your honour that it not for
> homework ?...
>
> G.
>
>
> _________________________________________________________________
> Join the world's largest e-mail service with MSN Hotmail.
> http://www.hotmail.com
>





^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Directories and files
  2002-02-20 17:54     ` Jos� Alberto
@ 2002-02-21  8:10       ` tmoran
  0 siblings, 0 replies; 8+ messages in thread
From: tmoran @ 2002-02-21  8:10 UTC (permalink / raw)


> which shows trees, files, sizes, etc. If anybody knows a library in ADA
> please tell me!!!
  Look at the recent thread on "Directory listings and path names" for
pointers to the proposed standard, and to several currently available
libraries.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Directories and files
@ 2002-02-21 10:09 Gautier Write-only-address
  0 siblings, 0 replies; 8+ messages in thread
From: Gautier Write-only-address @ 2002-02-21 10:09 UTC (permalink / raw)


>It is not for homework, I'm just writting a program for fun.
>If you want a certify I can send you a declaration signed by
>me and my lawyer :-)

Aaah... in that case there are two tools using GNAT.* resources
- see htmltree and html_dir in gnatpaqs.zip, URL below:

  http://www.mysunrise.ch/users/gdm/locaux.htm

Happy programming!
____________________________________________________________
Gautier  --  http://www.mysunrise.ch/users/gdm/index.htm#Ada

NB: For a direct answer, address on the Web site!


_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.




^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2002-02-21 10:09 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-19 21:23 Directories and files Jos� Alberto
2002-02-19 21:35 ` tmoran
2002-02-20  8:14   ` Jos� Alberto
2002-02-20 17:54     ` Jos� Alberto
2002-02-21  8:10       ` tmoran
2002-02-20  2:21 ` sk
     [not found] <mailman.1014237242.7594.comp.lang.ada@ada.eu.org>
2002-02-21  7:19 ` Jos� Alberto
  -- strict thread matches above, loose matches on Subject: below --
2002-02-21 10:09 Gautier Write-only-address

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