< prev index next >
src/java.base/windows/native/libjava/io_util_md.c
Print this page
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
@@ -582,5 +582,16 @@
if (SetFilePointerEx(h, distance, &pos, op) == 0) {
return -1;
}
return long_to_jlong(pos.QuadPart);
}
+
+jlong
+handleGetLength(FD fd) {
+ HANDLE h = (HANDLE) fd;
+ LARGE_INTEGER length;
+ if (GetFileSizeEx(h, &length) != 0) {
+ return long_to_jlong(length.QuadPart);
+ } else {
+ return -1;
+ }
+}
< prev index next >