mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-23 09:28:54 +02:00
set the corresponding p(ermission)mode of the file when creating,
2001-07-21 Hans Breuer <hans@breuer.org> * glib/giowin32.c (g_io_channel_new_file) : set the corresponding p(ermission)mode of the file when creating, otherwise a wronly file couldn't be overwritten (at least not on Win9x).
This commit is contained in:
@@ -1,3 +1,10 @@
|
|||||||
|
2001-07-21 Hans Breuer <hans@breuer.org>
|
||||||
|
|
||||||
|
* glib/giowin32.c (g_io_channel_new_file) : set the
|
||||||
|
corresponding p(ermission)mode of the file when creating,
|
||||||
|
otherwise a wronly file couldn't be overwritten (at least
|
||||||
|
not on Win9x).
|
||||||
|
|
||||||
2001-07-21 Hans Breuer <hans@breuer.org>
|
2001-07-21 Hans Breuer <hans@breuer.org>
|
||||||
|
|
||||||
* glib/giowin32.c : intial implementation of new API functions.
|
* glib/giowin32.c : intial implementation of new API functions.
|
||||||
|
@@ -1,3 +1,10 @@
|
|||||||
|
2001-07-21 Hans Breuer <hans@breuer.org>
|
||||||
|
|
||||||
|
* glib/giowin32.c (g_io_channel_new_file) : set the
|
||||||
|
corresponding p(ermission)mode of the file when creating,
|
||||||
|
otherwise a wronly file couldn't be overwritten (at least
|
||||||
|
not on Win9x).
|
||||||
|
|
||||||
2001-07-21 Hans Breuer <hans@breuer.org>
|
2001-07-21 Hans Breuer <hans@breuer.org>
|
||||||
|
|
||||||
* glib/giowin32.c : intial implementation of new API functions.
|
* glib/giowin32.c : intial implementation of new API functions.
|
||||||
|
@@ -1,3 +1,10 @@
|
|||||||
|
2001-07-21 Hans Breuer <hans@breuer.org>
|
||||||
|
|
||||||
|
* glib/giowin32.c (g_io_channel_new_file) : set the
|
||||||
|
corresponding p(ermission)mode of the file when creating,
|
||||||
|
otherwise a wronly file couldn't be overwritten (at least
|
||||||
|
not on Win9x).
|
||||||
|
|
||||||
2001-07-21 Hans Breuer <hans@breuer.org>
|
2001-07-21 Hans Breuer <hans@breuer.org>
|
||||||
|
|
||||||
* glib/giowin32.c : intial implementation of new API functions.
|
* glib/giowin32.c : intial implementation of new API functions.
|
||||||
|
@@ -1,3 +1,10 @@
|
|||||||
|
2001-07-21 Hans Breuer <hans@breuer.org>
|
||||||
|
|
||||||
|
* glib/giowin32.c (g_io_channel_new_file) : set the
|
||||||
|
corresponding p(ermission)mode of the file when creating,
|
||||||
|
otherwise a wronly file couldn't be overwritten (at least
|
||||||
|
not on Win9x).
|
||||||
|
|
||||||
2001-07-21 Hans Breuer <hans@breuer.org>
|
2001-07-21 Hans Breuer <hans@breuer.org>
|
||||||
|
|
||||||
* glib/giowin32.c : intial implementation of new API functions.
|
* glib/giowin32.c : intial implementation of new API functions.
|
||||||
|
@@ -1,3 +1,10 @@
|
|||||||
|
2001-07-21 Hans Breuer <hans@breuer.org>
|
||||||
|
|
||||||
|
* glib/giowin32.c (g_io_channel_new_file) : set the
|
||||||
|
corresponding p(ermission)mode of the file when creating,
|
||||||
|
otherwise a wronly file couldn't be overwritten (at least
|
||||||
|
not on Win9x).
|
||||||
|
|
||||||
2001-07-21 Hans Breuer <hans@breuer.org>
|
2001-07-21 Hans Breuer <hans@breuer.org>
|
||||||
|
|
||||||
* glib/giowin32.c : intial implementation of new API functions.
|
* glib/giowin32.c : intial implementation of new API functions.
|
||||||
|
@@ -1,3 +1,10 @@
|
|||||||
|
2001-07-21 Hans Breuer <hans@breuer.org>
|
||||||
|
|
||||||
|
* glib/giowin32.c (g_io_channel_new_file) : set the
|
||||||
|
corresponding p(ermission)mode of the file when creating,
|
||||||
|
otherwise a wronly file couldn't be overwritten (at least
|
||||||
|
not on Win9x).
|
||||||
|
|
||||||
2001-07-21 Hans Breuer <hans@breuer.org>
|
2001-07-21 Hans Breuer <hans@breuer.org>
|
||||||
|
|
||||||
* glib/giowin32.c : intial implementation of new API functions.
|
* glib/giowin32.c : intial implementation of new API functions.
|
||||||
|
@@ -1,3 +1,10 @@
|
|||||||
|
2001-07-21 Hans Breuer <hans@breuer.org>
|
||||||
|
|
||||||
|
* glib/giowin32.c (g_io_channel_new_file) : set the
|
||||||
|
corresponding p(ermission)mode of the file when creating,
|
||||||
|
otherwise a wronly file couldn't be overwritten (at least
|
||||||
|
not on Win9x).
|
||||||
|
|
||||||
2001-07-21 Hans Breuer <hans@breuer.org>
|
2001-07-21 Hans Breuer <hans@breuer.org>
|
||||||
|
|
||||||
* glib/giowin32.c : intial implementation of new API functions.
|
* glib/giowin32.c : intial implementation of new API functions.
|
||||||
|
@@ -1,3 +1,10 @@
|
|||||||
|
2001-07-21 Hans Breuer <hans@breuer.org>
|
||||||
|
|
||||||
|
* glib/giowin32.c (g_io_channel_new_file) : set the
|
||||||
|
corresponding p(ermission)mode of the file when creating,
|
||||||
|
otherwise a wronly file couldn't be overwritten (at least
|
||||||
|
not on Win9x).
|
||||||
|
|
||||||
2001-07-21 Hans Breuer <hans@breuer.org>
|
2001-07-21 Hans Breuer <hans@breuer.org>
|
||||||
|
|
||||||
* glib/giowin32.c : intial implementation of new API functions.
|
* glib/giowin32.c : intial implementation of new API functions.
|
||||||
|
@@ -1075,7 +1075,7 @@ g_io_channel_new_file (const gchar *filename,
|
|||||||
const gchar *mode,
|
const gchar *mode,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
int fid, flags;
|
int fid, flags, pmode;
|
||||||
GIOChannel *channel;
|
GIOChannel *channel;
|
||||||
|
|
||||||
enum { /* Cheesy hack */
|
enum { /* Cheesy hack */
|
||||||
@@ -1125,29 +1125,36 @@ g_io_channel_new_file (const gchar *filename,
|
|||||||
{
|
{
|
||||||
case MODE_R:
|
case MODE_R:
|
||||||
flags = O_RDONLY;
|
flags = O_RDONLY;
|
||||||
|
pmode = _S_IREAD;
|
||||||
break;
|
break;
|
||||||
case MODE_W:
|
case MODE_W:
|
||||||
flags = O_WRONLY | O_TRUNC | O_CREAT;
|
flags = O_WRONLY | O_TRUNC | O_CREAT;
|
||||||
|
pmode = _S_IWRITE;
|
||||||
break;
|
break;
|
||||||
case MODE_A:
|
case MODE_A:
|
||||||
flags = O_WRONLY | O_APPEND | O_CREAT;
|
flags = O_WRONLY | O_APPEND | O_CREAT;
|
||||||
|
pmode = _S_IWRITE;
|
||||||
break;
|
break;
|
||||||
case MODE_R | MODE_PLUS:
|
case MODE_R | MODE_PLUS:
|
||||||
flags = O_RDWR;
|
flags = O_RDWR;
|
||||||
|
pmode = _S_IREAD | _S_IWRITE;
|
||||||
break;
|
break;
|
||||||
case MODE_W | MODE_PLUS:
|
case MODE_W | MODE_PLUS:
|
||||||
flags = O_RDWR | O_TRUNC | O_CREAT;
|
flags = O_RDWR | O_TRUNC | O_CREAT;
|
||||||
|
pmode = _S_IREAD | _S_IWRITE;
|
||||||
break;
|
break;
|
||||||
case MODE_A | MODE_PLUS:
|
case MODE_A | MODE_PLUS:
|
||||||
flags = O_RDWR | O_APPEND | O_CREAT;
|
flags = O_RDWR | O_APPEND | O_CREAT;
|
||||||
|
pmode = _S_IREAD | _S_IWRITE;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
g_assert_not_reached ();
|
g_assert_not_reached ();
|
||||||
flags = 0;
|
flags = 0;
|
||||||
|
pmode = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
fid = open (filename, flags);
|
fid = open (filename, flags, pmode);
|
||||||
if (fid < 0)
|
if (fid < 0)
|
||||||
{
|
{
|
||||||
g_set_error (error, G_FILE_ERROR,
|
g_set_error (error, G_FILE_ERROR,
|
||||||
|
Reference in New Issue
Block a user