40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
# File 'ext/chunkio/chunkio_context.c', line 40
static VALUE chunkio_context_initialize(VALUE self, VALUE root)
{
char *p = StringValuePtr(root);
if (strlen(p) == 0) {
rb_raise(rb_eStandardError, "Context root path is not allowed empty string");
}
/* permission is fixed for now */
rb_funcall(rb_const_get(rb_cObject, rb_intern("FileUtils")), rb_intern("mkdir_p"), 1, root);
/* struct cio_ctx *ctx = cio_create(p, log_cb, CIO_DEBUG, 0); /\* flag *\/ */
struct cio_ctx *ctx = cio_create(p, 0, CIO_DEBUG, 0); /* flag */
if (!ctx) {
rb_raise(rb_eStandardError, "failed to create cio_ctx");
}
DATA_PTR(self) = ctx;
return Qnil;
}
|