Method: Archive::Entry#copy_lstat

Defined in:
ext/libarchive-0.1.1/ext/libarchive_entry.c

#copy_lstat(v_filename) ⇒ Object



843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
# File 'ext/libarchive-0.1.1/ext/libarchive_entry.c', line 843

static VALUE rb_libarchive_entry_copy_lstat(VALUE self, VALUE v_filename) {
  struct rb_libarchive_entry_container *p;
  const char *filename;
  struct stat s;
  Data_Get_Struct(self, struct rb_libarchive_entry_container, p);
  Check_Entry(p);
  Check_Type(v_filename, T_STRING);
  filename = RSTRING_PTR(v_filename);

  if (lstat(filename, &s) != 0) {
    #pragma GCC diagnostic ignored "-Wformat="
    #pragma GCC diagnostic ignored "-Wformat-extra-args"
    rb_raise(rb_eArchiveError, "Copy stat failed: %", strerror(errno));
    #pragma GCC diagnostic pop
  }

  archive_entry_copy_stat(p->ae, &s);
  return Qnil;
}