From: noer AT cygnus DOT com (Geoffrey Noer) Subject: Re: Unix pathname -> DOS pathname 30 Sep 1998 17:57:48 -0700 Message-ID: <19980929163238.59066.cygnus.gnu-win32@cygnus.com> References: <1 DOT 5 DOT 4 DOT 16 DOT 19980924022008 DOT 0eaf73ec AT fox DOT nstn DOT ca> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii To: Anders Norlander Cc: gnu-win32 AT cygnus DOT com On Thu, Sep 24, 1998 at 09:26:41PM +0200, Anders Norlander wrote: > > There actually seems to be a much better way to accomplish > Unix -> dos path conversion. > > According to the FAQ there are some intersting functions: > cygwin32_conv_to_full_posix_path > cygwin32_conv_to_full_win32_path > cygwin32_conv_to_posix_path > cygwin32_conv_to_win32_path > cygwin32_posix_path_list_p > cygwin32_posix_to_win32_path_list > cygwin32_posix_to_win32_path_list_buf_size > cygwin32_split_path > cygwin32_win32_to_posix_path_list > cygwin32_win32_to_posix_path_list_buf_size > > I don't know the prototypes for these functions, but if > I call cygwin32_conv_to_win32_path with the unix path > as the first argument and a buffer to hold the converted > path as the second argument I get the win32 path. > By looking at the source it would be possible to get the > exact prototypes. The developers ought to know about this. Yep. At least in the current sources, the protos are to be found in include/sys/cygwin.h: extern pid_t cygwin32_winpid_to_pid (int); extern void cygwin32_win32_to_posix_path_list (const char*, char*); extern int cygwin32_win32_to_posix_path_list_buf_size (const char*); extern void cygwin32_posix_to_win32_path_list (const char*, char*); extern int cygwin32_posix_to_win32_path_list_buf_size (const char*); extern void cygwin32_conv_to_win32_path (const char *, char *); extern void cygwin32_conv_to_full_win32_path (const char *, char *); extern void cygwin32_conv_to_posix_path (const char *, char *); extern void cygwin32_conv_to_full_posix_path (const char *, char *); extern int cygwin32_posix_path_list_p (const char *); extern void cygwin32_split_path (const char *, char *, char *); Documentation that's in the middle of being written (the development source snapshots include it) will define these and give a couple of examples. The sources have some useful comments as well. Note the the cygpath utility just calls the above functions. This is necessary for scripts that don't have access to the above functions directly. It is part of the development sources and will be in B20 which should be available in early October. -- Geoffrey Noer noer AT cygnus DOT com - For help on using this list (especially unsubscribing), send a message to "gnu-win32-request AT cygnus DOT com" with one line of text: "help".