Commit Graph

82 Commits

Author SHA1 Message Date
Brandon Craig
9928597543 repatch windows file delete 2015-03-06 14:37:06 -07:00
Brandon Craig
a188b15f2e fix java.io.File.delete() implementation for windows 2015-02-19 14:55:48 -07:00
Joshua Warner
836cc41320 bulk, global reformat 2014-07-11 13:25:22 -06:00
Joel Dice
9b7d0d1624 update copyright years 2014-04-23 15:33:41 -06:00
Joshua Warner
0e8d3d91ee fix build on mingw, which somehow doesn't recognize the UNICODE macro correctly 2014-03-24 10:51:44 -06:00
Joshua Warner
1dc932618f Use 0777/0666 permissions when creating dirs/files.
Just like openjdk, we now depend on the processes umask (0022, for
instance) to mask that into 0755 or 0666, for instance.

This fixes #57.
2013-12-06 22:22:16 -07:00
Joshua Warner
187d5dfde9 fix darwin build 2013-10-24 14:07:53 -06:00
Johannes Schindelin
320fc511dc Fix potential memory leak in RandomAccessFile#readBytes
This was noticed when copy-editing writeBytes.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2013-10-21 10:59:59 -05:00
Johannes Schindelin
8084cb6398 Fix indentation in java-io.cpp
This was noticed when copy-editing readBytes into writeBytes.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2013-10-21 10:59:59 -05:00
Johannes Schindelin
2c0a1c726d Add write support for RandomAccessFile
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2013-10-21 10:59:59 -05:00
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