340 |
340 |
}
|
341 |
341 |
|
342 |
342 |
/*
|
|
343 |
* call-seq:
|
|
344 |
* pathname.write(string, [offset]) -> fixnum
|
|
345 |
* pathname.write(string, [offset], open_args) -> fixnum
|
|
346 |
*
|
|
347 |
* See <tt>IO.write</tt>. Returns the byte length written.
|
|
348 |
*
|
|
349 |
*/
|
|
350 |
static VALUE
|
|
351 |
path_write(int argc, VALUE *argv, VALUE self)
|
|
352 |
{
|
|
353 |
VALUE args[4];
|
|
354 |
int n;
|
|
355 |
|
|
356 |
args[0] = get_strpath(self);
|
|
357 |
n = rb_scan_args(argc, argv, "12", &args[1], &args[2], &args[3]);
|
|
358 |
return rb_funcall2(rb_cIO, rb_intern("write"), 1+n, args);
|
|
359 |
}
|
|
360 |
|
|
361 |
/*
|
|
362 |
* call-seq:
|
|
363 |
* pathname.binwrite(string, [offset]) -> fixnum
|
|
364 |
* pathname.binwrite(string, [offset], open_args) -> fixnum
|
|
365 |
*
|
|
366 |
* See <tt>IO.binwrite</tt>. Returns the byte length written.
|
|
367 |
*
|
|
368 |
*/
|
|
369 |
static VALUE
|
|
370 |
path_binwrite(int argc, VALUE *argv, VALUE self)
|
|
371 |
{
|
|
372 |
VALUE args[4];
|
|
373 |
int n;
|
|
374 |
|
|
375 |
args[0] = get_strpath(self);
|
|
376 |
n = rb_scan_args(argc, argv, "12", &args[1], &args[2], &args[3]);
|
|
377 |
return rb_funcall2(rb_cIO, rb_intern("binwrite"), 1+n, args);
|
|
378 |
}
|
|
379 |
|
|
380 |
/*
|
343 |
381 |
* See <tt>File.atime</tt>. Returns last access time.
|
344 |
382 |
*/
|
345 |
383 |
static VALUE
|
... | ... | |
1151 |
1189 |
* - #binread(*args)
|
1152 |
1190 |
* - #readlines(*args)
|
1153 |
1191 |
* - #sysopen(*args)
|
|
1192 |
* - #write(string, *args)
|
|
1193 |
* - #binwrite(string, *args)
|
1154 |
1194 |
*
|
1155 |
1195 |
* === Utilities
|
1156 |
1196 |
*
|
... | ... | |
1197 |
1237 |
rb_define_method(rb_cPathname, "binread", path_binread, -1);
|
1198 |
1238 |
rb_define_method(rb_cPathname, "readlines", path_readlines, -1);
|
1199 |
1239 |
rb_define_method(rb_cPathname, "sysopen", path_sysopen, -1);
|
|
1240 |
rb_define_method(rb_cPathname, "write", path_write, -1);
|
|
1241 |
rb_define_method(rb_cPathname, "binwrite", path_binwrite, -1);
|
1200 |
1242 |
rb_define_method(rb_cPathname, "atime", path_atime, 0);
|
1201 |
1243 |
rb_define_method(rb_cPathname, "ctime", path_ctime, 0);
|
1202 |
1244 |
rb_define_method(rb_cPathname, "mtime", path_mtime, 0);
|