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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,942b3184b8c0c422 X-Google-Attributes: gid103376,public From: mfb@mbunix.mitre.org (Michael F Brenner) Subject: Re: Platform portable support of heir. file systems Date: 1996/12/19 Message-ID: <59b6ea$522@top.mitre.org>#1/1 X-Deja-AN: 204892781 references: <01bbec7f$453edcd0$24af1486@pc-phw> <1996Dec18.071612.1@eisner> organization: The MITRE Corporation, Bedford Mass. newsgroups: comp.lang.ada Date: 1996-12-19T00:00:00+00:00 List-Id: 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