GLib.IOChannel.new_file

function new_file(filename: String, mode: String): GLib.IOChannel {
    // Gjs wrapper for g_io_channel_new_file()
}
  

Open a file filename as a GLib.IOChannel using mode mode. This channel will be closed when the last reference to it is dropped, so there is no need to call GLib.IOChannel.prototype.close (though doing so will not cause problems, as long as no attempt is made to access the channel after it is closed).

filename

A string containing the name of a file

mode

One of "r", "w", "a", "r+", "w+", "a+". These have the same meaning as in fopen()

Returns

A GLib.IOChannel on success, null on failure.