Re: [eclipse-clp-users] canonical_path_bug/2 bug on Windows... again

From: Joachim Schimpf <jschimpf_at_...311...>
Date: Wed, 23 May 2012 13:35:06 +0200
Paulo Moura wrote:
...
> As you know, dealing with file-system is a portability nightmare, specially when considering both POSIX and Windows. The only practical solution will likely be to provide a library that forgoes the native support (from the point-of-view of interface) and provides a portability layer. I have something along these lines in Logtalk:
> 
> http://trac.logtalk.org/browser/trunk/examples/cc/osp.lgt
> http://trac.logtalk.org/browser/trunk/examples/cc/os.lgt

If I were to redo it from scratch, I'd probaly use a structured term
(instead of a string) as the OS-independent representation, similar to
what you suggested in file_name_parts/2 in http://logtalk.org/plstd/posi.pdf,
and with the added advantage that it covers URIs as well

file_name_parts('http://www.prolog-standard.org:8080/index.html', Parts)
Parts=[protocol(http), host('www.prolog-standard.org'), port(8080),
path('/'), base(index), extension('.html')]


-- Joachim
Received on Wed May 23 2012 - 11:35:07 CEST

This archive was generated by hypermail 2.3.0 : Wed Sep 25 2024 - 15:13:20 CEST