[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Dotgnu-pnet-commits] CVS: pnet/engine lib_dir.c,1.15,1.16 lib_file.c,1
From: |
Rhys Weatherley <address@hidden> |
Subject: |
[Dotgnu-pnet-commits] CVS: pnet/engine lib_dir.c,1.15,1.16 lib_file.c,1.9,1.10 |
Date: |
Thu, 26 Jun 2003 20:18:29 -0400 |
Update of /cvsroot/dotgnu-pnet/pnet/engine
In directory subversions:/tmp/cvs-serv21021/engine
Modified Files:
lib_dir.c lib_file.c
Log Message:
Convert '\' into '/' in pathnames to work around Windows programmers
who don't use "Path.DirectorySeparatorChar" in their C# code.
Index: lib_dir.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/engine/lib_dir.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -r1.15 -r1.16
*** lib_dir.c 17 Feb 2003 20:53:05 -0000 1.15
--- lib_dir.c 27 Jun 2003 00:18:26 -0000 1.16
***************
*** 107,111 ****
{
char *cpath;
! if (!(cpath = ILStringToAnsi(_thread, path)))
{
return IL_ERRNO_ENOMEM;
--- 107,111 ----
{
char *cpath;
! if (!(cpath = ILStringToPathname(_thread, path)))
{
return IL_ERRNO_ENOMEM;
***************
*** 121,125 ****
{
char *cpath;
! if (!(cpath = ILStringToAnsi(_thread, path)))
{
return IL_ERRNO_ENOMEM;
--- 121,125 ----
{
char *cpath;
! if (!(cpath = ILStringToPathname(_thread, path)))
{
return IL_ERRNO_ENOMEM;
***************
*** 135,139 ****
{
char *cpath;
! if (!(cpath = ILStringToAnsi(_thread, path)))
{
return IL_ERRNO_ENOMEM;
--- 135,139 ----
{
char *cpath;
! if (!(cpath = ILStringToPathname(_thread, path)))
{
return IL_ERRNO_ENOMEM;
***************
*** 157,161 ****
ILInt32 _IL_DirMethods_CreateDirectory(ILExecThread *_thread, ILString *path)
{
! return ILCreateDir(ILStringToAnsi(_thread, path));
}
--- 157,161 ----
ILInt32 _IL_DirMethods_CreateDirectory(ILExecThread *_thread, ILString *path)
{
! return ILCreateDir(ILStringToPathname(_thread, path));
}
***************
*** 165,169 ****
ILInt32 _IL_DirMethods_Delete(ILExecThread *_thread, ILString *path)
{
! return ILDeleteDir(ILStringToAnsi(_thread, path));
}
--- 165,169 ----
ILInt32 _IL_DirMethods_Delete(ILExecThread *_thread, ILString *path)
{
! return ILDeleteDir(ILStringToPathname(_thread, path));
}
***************
*** 175,180 ****
ILString *new_name)
{
! char * old_name_ansi = ILStringToAnsi(_thread, old_name);
! char * new_name_ansi = ILStringToAnsi(_thread, new_name);
if(old_name_ansi == NULL || new_name_ansi == NULL)
{
--- 175,180 ----
ILString *new_name)
{
! char * old_name_ansi = ILStringToPathname(_thread, old_name);
! char * new_name_ansi = ILStringToPathname(_thread, new_name);
if(old_name_ansi == NULL || new_name_ansi == NULL)
{
***************
*** 207,211 ****
ILString * name)
{
! return ILChangeDir(ILStringToAnsi(_thread,name));
}
--- 207,211 ----
ILString * name)
{
! return ILChangeDir(ILStringToPathname(_thread,name));
}
***************
*** 233,237 ****
* re-vamped a bit*/
! dirStream = ILOpenDir(ILStringToAnsi(_thread, path));
if(!dirStream)
{
--- 233,237 ----
* re-vamped a bit*/
! dirStream = ILOpenDir(ILStringToPathname(_thread, path));
if(!dirStream)
{
Index: lib_file.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/engine/lib_file.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** lib_file.c 24 Apr 2003 06:00:43 -0000 1.9
--- lib_file.c 27 Jun 2003 00:18:26 -0000 1.10
***************
*** 27,30 ****
--- 27,55 ----
#include "il_errno.h"
+ char *ILStringToPathname(ILExecThread *thread, ILString *str)
+ {
+ #ifdef IL_WIN32_NATIVE
+ /* Win32 understands both '/' and '\' in pathnames, so leave as-is */
+ return ILStringToAnsi(thread, str);
+ #else
+ char *path = ILStringToAnsi(thread, str);
+ char *temp;
+ if(!path)
+ {
+ return 0;
+ }
+ temp = path;
+ while(*temp != '\0')
+ {
+ if(*temp == '\\')
+ {
+ *temp = '/';
+ }
+ ++temp;
+ }
+ return path;
+ #endif
+ }
+
/*
* public static IntPtr GetInvalidHandle();
***************
*** 40,44 ****
ILBool _IL_FileMethods_ValidatePathname(ILExecThread *thread, ILString *path)
{
! char *cpath = ILStringToAnsi(thread, path);
if(cpath)
{
--- 65,69 ----
ILBool _IL_FileMethods_ValidatePathname(ILExecThread *thread, ILString *path)
{
! char *cpath = ILStringToPathname(thread, path);
if(cpath)
{
***************
*** 56,60 ****
ILInt32 _IL_FileMethods_GetFileType(ILExecThread * _thread, ILString * path)
{
! const char *cpath = ILStringToAnsi(_thread,path);
if(cpath)
{
--- 81,85 ----
ILInt32 _IL_FileMethods_GetFileType(ILExecThread * _thread, ILString * path)
{
! const char *cpath = ILStringToPathname(_thread,path);
if(cpath)
{
***************
*** 76,80 ****
ILNativeInt *handle)
{
! char *cpath = ILStringToAnsi(thread, path);
if(!cpath)
{
--- 101,105 ----
ILNativeInt *handle)
{
! char *cpath = ILStringToPathname(thread, path);
if(!cpath)
{
***************
*** 201,206 ****
ILString *src, ILString
*dest)
{
! char * src_ansi = ILStringToAnsi(_thread, src );
! char * dest_ansi = ILStringToAnsi(_thread, dest);
if(src_ansi == NULL || dest_ansi == NULL)
{
--- 226,231 ----
ILString *src, ILString
*dest)
{
! char * src_ansi = ILStringToPathname(_thread, src );
! char * dest_ansi = ILStringToPathname(_thread, dest);
if(src_ansi == NULL || dest_ansi == NULL)
{
***************
*** 215,219 ****
ILInt32 _IL_FileMethods_SetLastWriteTime(ILExecThread *thread, ILString
*path, ILInt64 ticks)
{
! char *path_ansi = ILStringToAnsi(thread, path);
if(!path_ansi)
--- 240,244 ----
ILInt32 _IL_FileMethods_SetLastWriteTime(ILExecThread *thread, ILString
*path, ILInt64 ticks)
{
! char *path_ansi = ILStringToPathname(thread, path);
if(!path_ansi)
***************
*** 231,235 ****
ILInt32 _IL_FileMethods_SetLastAccessTime(ILExecThread *thread, ILString
*path, ILInt64 ticks)
{
! char *path_ansi = ILStringToAnsi(thread, path);
if(!path_ansi)
--- 256,260 ----
ILInt32 _IL_FileMethods_SetLastAccessTime(ILExecThread *thread, ILString
*path, ILInt64 ticks)
{
! char *path_ansi = ILStringToPathname(thread, path);
if(!path_ansi)
***************
*** 247,251 ****
ILInt32 _IL_FileMethods_SetCreationTime(ILExecThread *thread, ILString *path,
ILInt64 ticks)
{
! char *path_ansi = ILStringToAnsi(thread, path);
if(!path_ansi)
--- 272,276 ----
ILInt32 _IL_FileMethods_SetCreationTime(ILExecThread *thread, ILString *path,
ILInt64 ticks)
{
! char *path_ansi = ILStringToPathname(thread, path);
if(!path_ansi)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Dotgnu-pnet-commits] CVS: pnet/engine lib_dir.c,1.15,1.16 lib_file.c,1.9,1.10,
Rhys Weatherley <address@hidden> <=