Benson Margulies wrote:
You are still passing char* variables into things like
check_writable,
so, no.
-----Original Message-----
From: Stephen J. Turnbull [mailto:stephenï¼ xemacs.org]
Sent: Tuesday, November 21, 2006 11:50 PM
To: Benson Margulies; Ben Wing
Cc: XEmacs-Beta(a)xemacs.org
Subject: Full Unicode Pathnames
Benson Margulies writes:
> Have you given any thought to supporting full Unicode file names on
> Win32? The semi-obvious strategy is to represent in UTF-8 in lisp and
> down to the bottom of the C code, and then transcode and call the W
> APIs.
Don't we already do that? I thought that was much of the point of the
Great Mule Merge of 21.5.6 or so. Ben?
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-beta
you're probably looking at 21.4 source. notice this from 21.5:
static int
check_writable (const Ibyte *filename)
{
#ifdef HAVE_EACCESS
return (qxe_eaccess (filename, W_OK) >= 0);
#else
/* Access isn't quite right because it uses the real uid
and we really want to test with the effective uid.
But Unix doesn't give us a right way to do it.
Opening with O_WRONLY could work for an ordinary file,
but would lose for directories. */
return (qxe_access (filename, W_OK) >= 0);
#endif
}
and this:
int
qxe_access (const Ibyte *path, int mode)
{
#ifdef WIN32_NATIVE
return mswindows_access (path, mode);
#else /* not WIN32_NATIVE */
Extbyte *pathout;
PATHNAME_CONVERT_OUT (path, pathout);
return access (pathout, mode);
#endif /* WIN32_NATIVE */
}
and this:
int
mswindows_access (const Ibyte *path, int mode)
{
DWORD attributes;
/* MSVC implementation doesn't recognize D_OK. */
if (is_unc_volume (path))
{
attributes = unc_volume_file_attributes (path);
if (attributes == -1)
{
errno = EACCES;
return -1;
}
}
else
{
Extbyte *pathext;
PATHNAME_CONVERT_OUT (path, pathext);
if ((attributes = qxeGetFileAttributes (pathext)) == -1)
{
/* Should try mapping GetLastError to errno; for now just indicate
that path doesn't exist. */
errno = EACCES;
return -1;
}
}
if ((mode & X_OK) != 0 && !mswindows_is_executable (path))
{
errno = EACCES;
return -1;
}
if ((mode & W_OK) != 0 && (attributes & FILE_ATTRIBUTE_READONLY) != 0)
{
errno = EACCES;
return -1;
}
if ((mode & D_OK) != 0 && (attributes & FILE_ATTRIBUTE_DIRECTORY) == 0)
{
errno = EACCES;
return -1;
}
return 0;
}
and this:
DWORD
qxeGetFileAttributes (const Extbyte * lpFileName)
{
if (XEUNICODE_P)
return GetFileAttributesW ((LPCWSTR) lpFileName);
else
return GetFileAttributesA ((LPCSTR) lpFileName);
}
if you're feeling really clever, try to figure out how the previous
function (and all the rest of intl-auto-encap-win32.c) was generated.
ben
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-beta