Skip to content

Commit

Permalink
Showing 3 changed files with 18 additions and 4 deletions.
4 changes: 2 additions & 2 deletions core/pom.xml
Original file line number Diff line number Diff line change
@@ -105,12 +105,12 @@
<dependency>
<groupId>com.github.jnr</groupId>
<artifactId>jnr-posix</artifactId>
<version>3.0.12</version>
<version>3.0.13-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.github.jnr</groupId>
<artifactId>jnr-constants</artifactId>
<version>0.8.7</version>
<version>0.8.8-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.github.jnr</groupId>
2 changes: 0 additions & 2 deletions spec/truffle/tags/core/file/rename_tags.txt

This file was deleted.

Original file line number Diff line number Diff line change
@@ -308,6 +308,22 @@ public int minor(int dev) {

}

@CoreMethod(names = "rename", isModuleFunction = true, required = 2)
public abstract static class RenameNode extends CoreMethodArrayArgumentsNode {

public RenameNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

@Specialization
public int rename(RubyString path, RubyString other) {
final String pathString = RubyEncoding.decodeUTF8(path.getByteList().getUnsafeBytes(), path.getByteList().getBegin(), path.getByteList().getRealSize());
final String otherString = RubyEncoding.decodeUTF8(other.getByteList().getUnsafeBytes(), other.getByteList().getBegin(), other.getByteList().getRealSize());
return posix().rename(pathString, otherString);
}

}

@CoreMethod(names = "rmdir", isModuleFunction = true, required = 1)
public abstract static class RmdirNode extends PointerPrimitiveNodes.ReadAddressPrimitiveNode {

0 comments on commit c0d9bc3

Please sign in to comment.