pspp-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] file-name.c and MinGW paths.


From: John McCabe-Dansted
Subject: Re: [PATCH] file-name.c and MinGW paths.
Date: Sun, 18 Feb 2007 09:06:46 +0900

On 2/18/07, Ben Pfaff <address@hidden> wrote:
Could you use ISSLASH from pathname.h, available from gnulib,
instead of defining your own IS_SLASH?

looks good.

Similarly, fn_is_absolute could just become a call to
pathname.h's IS_ABSOLUTE_PATH

Absolutely.

(or we could replace calls to
fn_is_absolute by uses of IS_ABSOLUTE_PATH; I'm ambivalent).

Since I'm lazy, I'd leave fn_is_absolute where it is for the moment,
and replace fn_is_absolute later when feeling bored and feeling 100%
confident that this was the right way to go.

Also, fn_dir_name could be replaced by dir_name from gnulib's
dirname.c, which is better thought out than fn_dir_name and
already handles \-style directory delimiters.

> When it canonicalizes  the path it converts all \'s to the posixish
> /'s. It should really also prefix all the paths with "A:" or, "C:" or
> whatever too.

I don't think the change to fn_get_identity is sufficient to fix
the problem, because as I read the implementation of
canonicalize_filename_mode, it doesn't properly handle \-style
directory separators anyhow.  I think that we'll need to submit a
fix for that to the gnulib folks.

Is there no way to ask Windows "Are these two files the same
file"?  It seems like a basic file system property that any
system would be able to answer.

Windows, does not answer this question, see e.g.
 http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=349270&SiteID=1
however the GetFullPathName function would help:
 http://msdn2.microsoft.com/en-us/library/aa364963.aspx
should be good enough for our purposes.

We also probably also convert the pathname to upper-case in
canonicalize as well, although that seems somehow ugly to me.

I think this is more complicated than necessary.  I'd suggest
just creating a function that takes a file name as its argument
and returns it prefixed by the proper directory name.  Based on
current usage, it would be fine for the string returned to be in
a static buffer.

can do.

The current uses are all very simple:

  pixbuf = gdk_pixbuf_new_from_file (PKGDATADIR "/value-labels.png", 0);

--
John C. McCabe-Dansted
PhD Student
University of Western Australia




reply via email to

[Prev in Thread] Current Thread [Next in Thread]