Commit graph

192 commits

Author SHA1 Message Date
Andrei Alexandrescu
49e4bb0ef0 Merge pull request #406 from denis-sh/get-rid-of-win9x-support
Get rid of win9x support
2012-02-18 12:32:37 -08:00
Vladimir Panteleev
f999f6ba0e std.file: Use stat instead of access to check file existence on POSIX
The reason for this change is the quirky behavior of access for SUID
programs: a file may not appear to "exist", despite that the program
would be able to open it just fine. The behavior in question is described
as follows in the access man page:

> The check is done using the calling process's real UID and GID, rather
> than the effective IDs as is done when actually attempting an operation
> (e.g., open(2)) on the file. This allows set-user-ID programs to easily
> determine the invoking user's authority.

While various operating systems provide eaccess or euidaccess functions,
these are not part of POSIX - so it's safer to use stat instead.
2012-02-18 21:35:04 +02:00
jmdavis
091609ca1e Moved February deprecations to March.
Having the January deprecations and February deprecations in the same
month seems a bit much to me, since we managed to have both of those
months have quite a few, whereas the next few months have very few if
any. And we're close to release too, so I'd prefer to avoid causing
issues by deprecating them now.
2012-02-11 02:44:46 -08:00
Denis Shelomovskij
99ab2b6175 Remove __file.d and it's using
* remove `useWfuncs` using
* remove std.__file using
* remove __file.d
* remove variables which have become unnecessary
* remove std.windows.charset import and alias in file.d
2012-02-10 14:27:34 +04:00
Daniel Green
58f4356ca2 Change version( Win32 ) to version( Windows ) when Win64 would be supported as well. 2012-01-16 22:10:18 -05:00
jmdavis
4e05818751 Added unit test for readLink cenforce fix. 2012-01-07 22:17:20 -08:00
jmdavis
69f0097d8b Fixed bug in std.file.readLink with regards to cenforce.
readLink should be checking that the result of readlink is not -1,
not that it's not 0, so the cenforce calls were wrong and were
resulting in incorrect behavior when readlink failed.
2012-01-07 18:03:36 -08:00
Walter Bright
10a2872229 fix public importing 2012-01-01 12:15:51 -08:00
jmdavis
e9dc4b94eb Versioned some of std.file's unit tests.
Some of the tests are too time-sensitive, and the sleeps are slowing the
tests down, so I've versioned off the ones that I believe are currently
causing issues for the autotester.

It looks like it may be possible to make the file times retrieved more
precise, which would lessen the need for sleeps. It would probably also
be prudent to combine a number of the tests, which would cut back on the
number sleeps needed. Hopefully, this change is enough to deal with
autotester's issues for now though.
2011-12-19 21:08:58 -08:00
jmdavis
7774df3203 Fixed it so that non-deprecated functions in std.file didn't call deprecated functions. 2011-12-09 00:43:32 -08:00
Andrei Alexandrescu
6ac45d88af Merge pull request #328 from jmdavis/deprecations
Applied deprecations for November 2011.
2011-12-04 13:04:07 -08:00
David Nadlinger
e312f9898b Strict @property syntax compliance.
This enables the test suite to build with the -property switch enabled.

std.cpuid: vendor()/processor() have not been converted to properties in accordance to core.cpuid.
std.xml: Element.text() cannot be a property due to the optional parameter.
2011-12-04 09:56:14 +01:00
alexrp
6460899b8a Use D_LP64 to make bitness-based decisions, not X86(_64). 2011-11-27 16:11:23 +01:00
jmdavis
afb5a1c7ce Applied deprecations for November 2011. 2011-11-21 00:24:57 -08:00
jmdavis
100733041f Made core.thread import in std.file non-selective.
Bug# 314 just makes it create import conflicts when compiling with
-unittest. It works just as well (better given bug# 314) as a normal
import.
2011-11-14 20:27:53 -08:00
Walter Bright
eaeb1a1516 Merge pull request #325 from klickverbot/file-osx64
Fix std.file on OS X x86_64.
2011-11-14 02:01:09 -08:00
jmdavis
9824a5bbae Added a clarifying note to std.file.symlink. 2011-11-13 17:17:22 -08:00
Andrei Alexandrescu
703f612973 Fixed wrong C library lookups 2011-11-12 21:55:22 -06:00
David Nadlinger
5099cf7fad Fix std.file on OS X x86_64.
The previous translation of struct_stat64 did not account for LP64 changes in C types.
2011-11-12 22:14:09 +01:00
Dmitry Olshansky
8d6852f221 fix build bug on win32 2011-11-01 01:57:30 +04:00
jmdavis
6fddf34157 Adjustments to std.file.readLink for issue 6814.
http://d.puremagic.com/issues/show_bug.cgi?id=6814
2011-10-23 23:34:49 -07:00
jmdavis
256976dddd Removed "scheduled for deprecation" pragmas.
The pragmas have not been as effective as we might have liked, since
they only work with templates and can't tell you where in your code you
need to make changes, and they seemed to have been more annoying to
programmers than helpful, so we're going to discontinue them. We'll
leave them in for stuff that's actually been deprecated until deprecated
has been improved enough to take a message, but we'll leave "scheduled
for deprecation" messages to the documentation and changelog.
2011-10-23 23:11:17 -07:00
jmdavis
b9b8337ccd Renamed UtfException to UTFException to match other uses of UTF.
I created an alias for UtfException and scheduled it for deprecation
(with a fairly short time to deprecation given that it's a simple
renaming).
2011-09-26 22:18:18 -07:00
k-hara
2e8f771201 Fix std.file unittest in Windows 2011-09-23 02:43:16 +09:00
Vladimir Panteleev
59e4fd4842 std.file: Add (query-only) support for symlinks on Windows
This includes followSymlink support, which is crucial for correct
rmdirRecurse behavior.
2011-09-22 14:13:31 +03:00
Vladimir Panteleev
c79366f287 std.file: Fix followSymlink behavior in subdirectories 2011-09-22 12:33:18 +03:00
Vladimir Panteleev
a8b1b9eba7 std.file: Add dirEntries with glob filter 2011-09-22 12:24:57 +03:00
Vladimir Panteleev
32fb75c3e2 std.file: Grammar (it's -> its) 2011-09-22 11:54:46 +03:00
Vladimir Panteleev
e180ef4caa std.file: Fix incorrect deprecation message for "listdir" alias 2011-09-22 11:27:59 +03:00
Lars T. Kyllingstad
ff4fb88db7 Update std.datetime and std.file for new std.path 2011-08-18 08:30:22 +02:00
jmdavis
41b9078cbf Fix Windows unit tests. 2011-08-15 20:42:10 -07:00
jmdavis
7eee94d2a8 Fix Windows build. 2011-08-15 03:24:29 -07:00
jmdavis
c2984bb00f Improvements to std.file unit tests to fix periodic test failures. 2011-08-14 16:21:06 -07:00
Andrei Alexandrescu
537c59c79e Merge pull request #178 from jmdavis/deprecation
Deprecated stuff which was scheduled to be deprecated in August 2011.
2011-08-14 11:04:21 -07:00
Daniel Green
dcbfae3364 Merge GDC Win64 changes. 2011-08-14 00:52:10 -04:00
jmdavis
6f23591aba Undeprecated std.file.listdir.
We need to expand on dirEntries' capabilities before deprecating
listdir. It has now been rescheduled for deprecation in November.
2011-08-13 18:08:30 -07:00
jmdavis
b9accb2217 Merge branch 'master' into deprecation
Conflicts:
	std/string.d
2011-08-09 00:44:05 -07:00
jmdavis
18455ef019 Deprecated functions in std.file which were scheduled for deprecation in August 2011. 2011-08-08 23:45:47 -07:00
Vladimir Panteleev
bcbfe2d433 Various DDoc syntax fixes 2011-08-07 22:59:37 +03:00
David Nadlinger
6a818c645c Run all std.file unit tests on OS X as well.
I can see no obvious reason why they wouldn't work there, and indeed they all pas on my OS X Lion box.
2011-07-30 10:18:03 +02:00
David Nadlinger
dc0bfdb1ec Use lstat64() on OS X like on other Posix systems.
Previously, the code was special-cased to use `stat64()` on OS X for no apparent reason (I searched the logs, but couldn't find anything obvious). This also caused the new `symlink()` unit tests to fail.
2011-07-30 10:17:36 +02:00
jmdavis
823683febf Some messages to help diagnose sporadic test failure in std.file. 2011-07-30 01:07:20 -07:00
jmdavis
4bbdfc06ea Okay, _actually_ fix Windows build break.
I really need to get my Windows setup working again...
2011-07-29 23:40:32 -07:00
jmdavis
0f0d1f1565 Fix Windows build break. 2011-07-29 23:39:24 -07:00
jmdavis
cafe6c4380 Templated symlink and readLink based on character type.
Now that toUTFz is in Phobos, we can start templatizing std.file's
function's based on character type.
2011-07-23 21:03:24 -07:00
jmdavis
c6f53e9358 Merge branch 'master' into symlink 2011-07-23 14:02:59 -07:00
KennyTM~
32d24ea24d std.file.read: Create the uinitialized arrays using ubyte[] to ensure NO_SCAN after commit 78ace9c 2011-07-17 15:41:14 +08:00
KennyTM~
df4e92d712 (Minor cleanup) Change some idiomic GC.malloc usage to uninitializedArray
Simplify the common pattern `(cast(T*)GC.malloc(T.sizeof * n, NO_SCAN))[0 .. n]` to the new function `uninitializedArray!(T[])(n)`.

Note that there was some `NO_SCAN` attributes originally determined at runtime using `typeid()`, but now is determined statically using `hasIndirection!()` from the implementation of `uninitializedArray`.
There were also some `GC.malloc` usage looks like `uninitializedArray` in `std.parallelism` but I'm leaving it alone for someone who is more familiar with this module ;).
2011-07-14 04:29:34 +08:00
jmdavis
5fcd6132d9 Merge branch 'master' into symlink
Conflicts:
	std/file.d
2011-07-12 23:23:56 -07:00
jmdavis
7893ce2342 Removed alias which the spellchecker will catch.
Base on discussions on the Announce group with regards to deprecation,
it sounds like it would be reasonable to skip the deprecation step with
simple function renaming that the compiler will catch and tell you the
corrected name with its spellchecker. So, I'm removing the alias for
isSymLink and just fixing the name straight up. It's unlikely that all
that many people are using it yet anyway, since it hasn't been around
for very long.
2011-07-12 18:37:43 -07:00