Skip to content

Commit

Permalink
Showing 3 changed files with 22 additions and 6 deletions.
3 changes: 0 additions & 3 deletions spec/truffle/tags/core/file/stat/comparison_tags.txt

This file was deleted.

3 changes: 0 additions & 3 deletions spec/truffle/tags/core/file/utime_tags.txt

This file was deleted.

Original file line number Diff line number Diff line change
@@ -297,6 +297,28 @@ public int umask(int mask) {

}

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

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

@Specialization
public int utimes(RubyString path, RubyBasicObject pointer) {
final String pathString = RubyEncoding.decodeUTF8(path.getByteList().getUnsafeBytes(), path.getByteList().getBegin(), path.getByteList().getRealSize());

final int result = posix().utimes(pathString, PointerPrimitiveNodes.getPointer(pointer));
if (result == -1) {
CompilerDirectives.transferToInterpreter();
throw new RaiseException(getContext().getCoreLibrary().errnoError(posix().errno(), this));
}

return result;
}

}

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

0 comments on commit 368177a

Please sign in to comment.