Feature #8050

struct stat to VALUE should be accessable from the C-API

Added by Hans Mackowiak about 1 year ago. Updated 7 months ago.

[ruby-core:53225]
Status:Closed
Priority:Normal
Assignee:Nobuyoshi Nakada
Category:core
Target version:2.1.0

Description

filc.c has methods to turn an struct stat into an File::Stat, the problem is that this methods are not accessable from the outside, and cant me mimiced my coping into the c-Ext code.

so it would be good if there where a VALUE rbstatnew(stuct stat); or something like that for the C-API

file.c.rb_stat_new.patch Magnifier (1.83 KB) Eric Hodel, 03/11/2013 12:31 PM

Associated revisions

Revision 43107
Added by Nobuyoshi Nakada 7 months ago

file.c: export rbstatnew

  • file.c (statnew0): constify.
  • file.c (rbstatnew): constify and export. based on a patch by Hanmac (Hans Mackowiak) at . [Feature #8050]

Revision 43108
Added by Nobuyoshi Nakada 7 months ago

file/stat.c: fix commit miss

  • ext/-test-/file/stat.c: extension library to test [Feature #8050].

History

#1 Updated by Nobuyoshi Nakada about 1 year ago

:+1:

#2 Updated by Eric Hodel about 1 year ago

  • File file.c.rb_stat_new.patchMagnifier added
  • Category set to core
  • Status changed from Open to Assigned
  • Assignee changed from ruby-core to Yukihiro Matsumoto
  • Target version set to 2.1.0

This patch seems to implement the feature.

#3 Updated by Nobuyoshi Nakada about 1 year ago

vote for ruby/io.h.

#4 Updated by Andre Nathan about 1 year ago

Can we also have a way to create a Dir object from a DIR pointer? Something like rbdirnew(DIR *dir).

#5 Updated by Eric Hodel about 1 year ago

Please open separate feature request for DIR * -> Dir

#6 Updated by Yui NARUSE 7 months ago

  • Assignee changed from Yukihiro Matsumoto to Nobuyoshi Nakada

this is nobu's issue because this is C API.

#7 Updated by Nobuyoshi Nakada 7 months ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r43107.
Hans, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


file.c: export rbstatnew

  • file.c (statnew0): constify.
  • file.c (rbstatnew): constify and export. based on a patch by Hanmac (Hans Mackowiak) at . [Feature #8050]

Also available in: Atom PDF