[Ecls-list] Windows network pathnames
Juan Jose Garcia-Ripoll
jjgarcia at users.sourceforge.net
Thu May 8 10:40:18 UTC 2008
On Thu, May 8, 2008 at 12:22 PM, P M <pls.mrjm at gmail.com> wrote:
> > Does anybody know how to specify a network pathname correctly (on
> Windows)?
>
> ...seems that I'm the only one in universe using Windows + ECL + network
> paths -- is this really so?
Seems so.
In any case, I think your problem is related to a POSIX issue that was
filed some time ago. Namely, a filename with two slashes at the
beginning should be parsed as an ordinary file path. In other words
//foo/a should be interpreted as /foo/a. I include below a patch that
undoes this change for Windows. Can you try it? If it works for you, I
will commit it.
Index: src/c/pathname.d
===================================================================
RCS file: /project/ecl/cvsroot/ecl/src/c/pathname.d,v
retrieving revision 1.95
diff -u -r1.95 pathname.d
--- src/c/pathname.d 30 Apr 2008 14:24:21 -0000 1.95
+++ src/c/pathname.d 8 May 2008 10:36:40 -0000
@@ -551,11 +551,20 @@
logical = FALSE;
device = parse_word(s, is_colon, WORD_INCLUDE_DELIM | WORD_EMPTY_IS_NIL |
WORD_DISALLOW_SLASH, start, end, ep);
+#if !defined(_MSC_VER) && !defined(mingw32)
if (device == @':error' || device == Cnil) {
/* We only parse a hostname when the device was present. */
device = Cnil;
host = Cnil;
- } else if (!ecl_stringp(device)) {
+ }
+#else
+ if (device == @':error') {
+ /* We only parse a hostname when the device was present. */
+ device = Cnil;
+ host = Cnil;
+ }
+#endif
+ else if (!ecl_stringp(device)) {
return Cnil;
} else {
/* Files have no effective device. */
@@ -899,9 +908,11 @@
writestr_stream(":", buffer);
}
if (host != Cnil) {
+#if !defined(_MSC_VER) && !defined(mingw32)
if (y == Cnil) {
writestr_stream("file:", buffer);
}
+#endif
writestr_stream("//", buffer);
si_do_write_sequence(host, buffer, MAKE_FIXNUM(0), Cnil);
}
More information about the ecl-devel
mailing list