Commit Graph

72 Commits

Author SHA1 Message Date
Johannes Schindelin
18f6f7881a RandomAccessFile: support opening for read/write
So far, we only allowed opening in read-only mode. Now, we also support
read/write mode in addition.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2013-10-21 10:55:26 -05:00
Joshua Warner
b3d4f33522 fix memory leak in Java_java_io_File_lastModified (exposed in debug mode) 2013-10-17 13:54:59 -06:00
Johannes Schindelin
ba10a58e3b Support java.io.File#lastModified not only on Windows
There was already non-Windows support, but it was put into the
Windows-specific part. Move it outside.

While at it, change the left-over 'st' to 'fileStat' to fix the
compilation.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2013-10-17 14:22:59 -05:00
Joshua Warner
314f18644f make getChars and releaseChars static, to prevent them being confused with implementations in other objects if they're not inlined (debug mode) 2013-09-06 08:47:46 -06:00
Dan Cunningham
0db1a2c414 The unlink/_wunlink call will not delete directories, use remove/_wremove instead 2013-08-28 15:27:31 -06:00
Joel Dice
87b02eb949 update copyright years
Previously, I used a shell script to extract modification date ranges
from the Git history, but that was complicated and unreliable, so now
every file just gets the same year range in its copyright header.  If
someone needs to know when a specific file was modified and by whom,
they can look at the Git history themselves; no need to include it
redundantly in the header.
2013-07-02 20:52:38 -06:00
Joshua Warner
cb11e21f95 force unicode support in java-io.cpp when including windows.h 2013-06-04 11:52:18 -06:00
Joshua Warner
8df12d5003 Use native windows APIs for File.exists()
On windows, there are obscure cases where _wstat can return non-zero for a path that
actually exists, but the native GetFileAttributes returns valid attributes.  This is
the case in particular when the user or process doesn't have permissions to access
the directory (for instance, anything outside of %temp%\Low, when running as a
low-integrity process).

This was causing problems with .mkdirs() - which first tries to check if the parent
exists, and creates it if it doesn't. In our particular case, the exists() was
returning false for the parent, even though it exists, and .mkdir() works fine,
mkdirs() fails for the same directory.
2013-05-31 11:17:21 -06:00
Joel Dice
b3978c0a0a fix msvc build 2013-03-04 11:09:59 -07:00
Joel Dice
b38eecbefa specify O_BINARY when opening files on Windows 2013-02-07 11:35:48 -07:00
Alexey Pelykh
f2d2c9af29 Fix for windows ::open 2013-02-07 11:43:39 +02:00
Alexey Pelykh
41c7269896 Support new WinRT interop 2013-02-07 11:39:20 +02:00
Alexey Pelykh
34179f3332 Added comments regarding java.io.File.toAbsolute() and WinRT/WP8 2013-02-07 11:39:19 +02:00
Alexey Pelykh
c33c148b6b Add notifications about improvements possible 2013-02-07 11:39:18 +02:00
Alexey Pelykh
cb46cb0ba8 WP8/WinRT : Proper absolute path
WP8/WinRT : Last modified time
2013-02-07 11:39:17 +02:00
Alexey Pelykh
ebf6277660 java.io.RandomAccessFile for WinPhone8 / WinRT 2013-02-07 11:39:16 +02:00
Alexey Pelykh
3f22c6d8e3 Remove debug code 2013-02-07 11:39:15 +02:00
Alexey Pelykh
a03fda0c1d Instead of throwing exception, just return initial file name 2013-02-07 11:39:15 +02:00
Alexey Pelykh
4840f4a019 Fixes to WP8/WinRT support 2013-02-07 11:39:03 +02:00
Victor Shcherb
ce1f76a3e9 Add last modified to file 2013-02-07 11:39:01 +02:00
Alexey Pelykh
0cbaad6495 Windows Phone 8 / Windows RT initial support
Conflicts:

	makefile
2013-02-07 11:38:57 +02:00
Victor Shcherb
ba80761128 Add android redirect to logcat 2013-02-07 11:38:55 +02:00
Alexey Pelykh
57f4463c4c RandomAccessFile 2013-02-07 11:38:50 +02:00
Joel Dice
0addd8c814 update copyright years 2012-05-11 17:43:27 -06:00
Joel Dice
9a50e69587 remove debug logging 2012-03-17 22:42:15 -06:00
Joel Dice
4aefa211a3 File.createNewFile should return false if the file already exists 2012-03-13 08:26:51 -06:00
Joel Dice
574a8ea1e2 Merge branch 'master' into prv-ga-merge 2012-02-27 13:28:06 -07:00
Joel Dice
c5ef39f2bd implement File.getAbsoluteFile for Windows 2012-02-16 18:19:01 -07:00
Dain
84185f0884 Merge remote branch 'origin/http_url' into prv-ga-merge 2012-02-16 11:08:53 -07:00
Joshua Warner
bbb4529752 implement File.setExecutable(), File.canExecute(), and File.createTempFile() 2012-02-09 14:23:24 -07:00
Joshua Warner
edc768f837 implement File.setExecutable(), File.canExecute(), and File.createTempFile() 2012-02-09 14:04:42 -07:00
Dain
a6753c3dc3 Request a share mode of both reading and writing for RandomAccessFile open.
This change allows reading and writing to happen concurrently on the
file on Windows.
2012-01-19 15:10:45 -07:00
Joel Dice
916c96c2b9 fix access violation introduced in last commit 2011-09-14 13:27:17 -06:00
Brian Haar
446c09dd33 Fix for File.length() integer overflow on 32-bit Windows.
The File.length() method was returning a signed 32-bit value
on 32-bit Windows systems.  This was causing an integer overflow
on file sizes greater than 2 GB.  This appears to be caused by
the way Windows handles the STAT() function.  This patch checks
whether the current platform is Windows then uses the Windows API
to get the correct file size and return it as a jlong.
2011-09-14 13:18:20 -06:00
Joel Dice
d09e5ee8eb fix Windows build regression 2011-08-15 16:37:15 -06:00
Anonymous
3d7c65d314 implement File.getAbsolutePath()/File.getAbsoluteFile() on Unix platforms 2011-08-11 08:52:49 -06:00
Joel Dice
e3662f13a9 update copyright years and increment version number 2011-07-13 08:25:21 -06:00
Matt Klich
c7c0a45a61 Revert "OSX Lion build changes"
This commit introduced conditional includes which is not the preferred
method. Will do it in the makefile instead.

This reverts commit 7148556979.
2011-06-01 13:56:03 -06:00
Matt Klich
7148556979 OSX Lion build changes 2011-05-26 11:57:30 -06:00
Joel Dice
220f7760b7 fix MSVC build regressions 2011-01-21 16:14:21 -07:00
Joel Dice
4a9ff55060 File.length should return 0 for non-existent files 2011-01-17 09:48:34 -07:00
Joel Dice
b6978c6c68 always create file if necessary in Java_java_io_FileOutputStream_open
Previously, we would only create the file if it did not already exist
*and* we weren't appending.  Now we do so whether appending or not.
2011-01-14 11:26:00 -07:00
Joel Dice
d12d33d716 fix memory leak in Java_java_io_File_length 2011-01-14 08:13:49 -07:00
Joel Dice
a5742f5985 update copyright years 2010-12-05 20:21:09 -07:00
Joel Dice
74a87a7f4f use _waccess on windows to implement File.can{Read|Write} 2010-09-12 14:46:14 -06:00
Zsombor Gegesy
6752505cb8 add File.canRead()/File.canWrite() implementation 2010-09-11 21:23:46 +02:00
Zsombor Gegesy
1daa93d3c4 add ability to append to files 2010-08-16 09:23:48 -06:00
JET
c666ab58e3 Improved (should now be complete) Unicode support (UTF-8 for *nix and UTF-16 for Windows). 2010-04-20 10:03:07 -06:00
Joel Dice
b1a1391093 skip "." and ".." in File.list{Files} to match Sun 2010-01-09 19:18:39 -07:00
Joel Dice
30db38ebd6 replace calls to ExceptionOccurred with calls to ExceptionCheck
The latter is cheaper (avoids a state transition and possible memory
allocation) when we just want to know if an exception is thrown
without needing a handle to that exception.
2009-12-16 19:25:03 -07:00