Skip to content

Commit

Permalink
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions core/src/main/java/org/jruby/RubyFile.java
Original file line number Diff line number Diff line change
@@ -217,6 +217,12 @@ public static RubyClass createFileClass(Ruby runtime) {
// File::Constants module is included in IO.
runtime.getIO().includeModule(constants);

if (Platform.IS_WINDOWS) {
// readlink is not available on Windows. See below and jruby/jruby#3287.
// TODO: MRI does not implement readlink on Windows, but perhaps we could?
fileClass.searchMethod("readlink").setNotImplemented(true);
}

return fileClass;
}

@@ -1044,6 +1050,13 @@ public static IRubyObject symlink(ThreadContext context, IRubyObject recv, IRuby
@JRubyMethod(required = 1, meta = true)
public static IRubyObject readlink(ThreadContext context, IRubyObject recv, IRubyObject path) {
Ruby runtime = context.runtime;

if (Platform.IS_WINDOWS) {
// readlink is not available on Windows. See above and jruby/jruby#3287.
// TODO: MRI does not implement readlink on Windows, but perhaps we could?
throw runtime.newNotImplementedError("readlink");
}

JRubyFile link = file(path);

try {

0 comments on commit 70c6156

Please sign in to comment.