comp.lang.ada
 help / color / mirror / Atom feed
From: mfb@mbunix.mitre.org (Michael F Brenner)
Subject: Re: Platform portable support of heir. file systems
Date: 1996/12/19
Date: 1996-12-19T00:00:00+00:00	[thread overview]
Message-ID: <59b6ea$522@top.mitre.org> (raw)
In-Reply-To: 1996Dec18.071612.1@eisner


Paul Whittington said:
> I was just working on one of our support packages that interfaces to the
> host OS to do file I/O and can't find any support in the Ada Annex set for
> a portable way of accessing heir. file systems.  I need things like
> "MakeDirectory", "RemoveDirectory", etc.

Larry Kilgallen said:
> On VMS:
>       Directories can only be nested 8 deep or so if you want
>       the files they contain to be backed up.
        ... (and other limitations)
> I am certain that other operating systems have quirks as well,
> especially when one gets into permissible name lengths and
> character sets (which are _not_ necessarily the same as for files).
> A common package for directory manipulation would not seem to be
> very "portable" if the rules differ on each operating system.

Yes there are differences in the limitations of heirarchical file systems.
That does NOT lead me to the conclusion that we should not standardize
a common subset. When a url, server name, drive name, directory name,
filename, or query exceeds the permissions, number of levels, name length,
character set, or permissible operations, then raise one of the exceptions
url_could_not_be_created, url_could_not_be_located, url_could_not_be_read, 
url_could_not_be_written, url_could_not_be_deleted, 
url_could_not_be_made_the_default_directory, or 
url_is_too_complicated_for_the_target_system.

Mike Brenner says:
IMO we should standardize a set of machine independent operations on
URLs that are equally applicable to all major operating systems, yet
raise the correct exceptions when, for example, someone puts spaces
in the middle of a filename on a system that prohibits unquoted spaces,
such as during ftp to Windows NT or Macintoshes. The facts (VMS has
generational datasets while NT does not, various systems have different
limitations, DOS is limited to 8.3 characters, devices are handled
differently, and quotation characters are incompatible: double quotes
versus backslash versus single quotes) do not prevent standardization 
of a URL object that will handle the common aspects of file systems. 

The following is a strawman proposal to start discussion of such
a standard visible part, (whose body would be implemented using 
existing Ada-95 facilities, annexes, and interfaces). 

package url_control is

  subtype urls is string;

  -- Example of a URL:
  --
  -- http://email:port/disk:file1/file2/.../filen#anchor?arg1?arg2?...?argk
  --
  -- @ Separators (://, :, /, #, ?)
  -- @ Words (protocol, email, port, disk, file, anchor, arg)
  -- @ Nonquoted words may contain alphanumerics, ~, _, !, @, -, and periods
  -- @ Quoted words may contain anything, doubling the quotes

  procedure url_break_apart (url: urls;
                             protocol_start:  out natural;
                             protocol_finish: out natural;
                             internet_start:  out natural;
                             internet_finish: out natural;
                             port_start:      out natural;
                             port_finish:     out natural;
                             disk_start:      out natural;
                             disk_finish:     out natural;
                             file_start:      out natural;
                             file_finish:     out natural;
                             anchor_start:    out natural;
                             anchor_finish:   out natural;
                             args_start:      out natural;
                             args_finish:     out natural);

  procedure directory_changeto    (name: urls);
  procedure directory_create      (name: urls);
  function  directory_current      return urls;
  procedure directory_remove      (name: urls);
  function  directory_get_first   (pattern: urls) return urls;
  function  directory_get_next     return urls;
  function  directory_temp         return urls;

  type systems is (default_system,
                   compatible_system,
                   fruit_system,
                   open_system,
                   vegetable_system);

  procedure set_system (system: systems); 
  function system return systems;

  function end_of_line_string    (system: systems := default_system)
                                  return string;


  function file_name_separator   (system: systems := default_system)
                                  return character;

    -- File name separator might be a period or slash depending on
    -- the operating system.

  function environment (variable: string) return string;
  procedure set_environment (variable: string; value: string);

  procedure delete (url: urls);
  procedure rename (old_url, new_url: urls);

  procedure low_level_display_without_loading_text_io (message: string);

end url_control;

with url_control;
package net_control is

  -- Send and receive files, messages, or queries across the net. 

  procedure transfer (source, destination: url_control.urls);
end net_control;

Mike Brenner mikeb@mitre.org




  parent reply	other threads:[~1996-12-19  0:00 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-12-18  0:00 Platform portable support of heir. file systems Paul Whittington
1996-12-18  0:00 ` Larry Kilgallen
1996-12-18  0:00   ` Tarjei T. Jensen
1996-12-18  0:00     ` Larry Kilgallen
1996-12-20  0:00     ` Robert Dewar
1996-12-21  0:00       ` Tarjei T. Jensen
1996-12-21  0:00         ` Larry Kilgallen
1996-12-22  0:00           ` Robert Dewar
1996-12-23  0:00             ` Larry Kilgallen
1996-12-22  0:00           ` Tarjei T. Jensen
1996-12-22  0:00         ` Robert Dewar
1996-12-19  0:00   ` Michael F Brenner [this message]
1996-12-19  0:00     ` Larry Kilgallen
1996-12-19  0:00       ` Michael F Brenner
1996-12-19  0:00         ` Larry Kilgallen
1996-12-20  0:00           ` Robert A Duff
1996-12-23  0:00   ` David J. Fiander
1996-12-19  0:00 ` Robert Dewar
1996-12-19  0:00 ` Robert I. Eachus
replies disabled

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