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')] -- JoachimReceived 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