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.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,225336ae711b78f1 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!34g2000yqp.googlegroups.com!not-for-mail From: Gautier write-only Newsgroups: comp.lang.ada Subject: Re: Open URLs Date: Sun, 3 Jan 2010 10:36:04 -0800 (PST) Organization: http://groups.google.com Message-ID: <4f63b3f3-3733-433f-969d-388088cda872@34g2000yqp.googlegroups.com> References: NNTP-Posting-Host: 92.106.127.36 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1262543764 30209 127.0.0.1 (3 Jan 2010 18:36:04 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sun, 3 Jan 2010 18:36:04 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: 34g2000yqp.googlegroups.com; posting-host=92.106.127.36; posting-account=gRqrnQkAAAAC_02ynnhqGk1VRQlve6ZG User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; fr; rv:1.8.1.14) Gecko/20080612 Fedora/2.0.0.14-20080612.fc8.acer Firefox/2.0.0.14,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:8583 Date: 2010-01-03T10:36:04-08:00 List-Id: > I am looking for a way to open URLs (like "file:///home/vlc/file") as > files - as you would do with "Open (Handle, In_File, "/home/vlc/ > file")". > > I could surely just remove the heading "file://", but this would still > leave me with the problem of special characters like "file:///home/vlc/ > name%20with%20spaces". > > Does anybody know of a way to translate URLs to paths? What about doing successive string replacements: "file://" -> "" "%20" -> " " etc. ? Probably you need to make a "Replace_all" function using Ada.Strings.Fixed's routines (unless it's already there), then it should be straightforward. ______________________________________________________________ Gautier's Ada programming -- http://gautiersblog.blogspot.com/