Commit graph

233 commits

Author SHA1 Message Date
Ferdinand Majerech
7d0f4f665a DDoc: file.d: Exceptions thrown (except slurp)
Added all missing Throws:, with the exception of slurp,
which might throw pretty much anything
(at least Exception, ErrnoException, ConvException, maybe FormatException, gave up on trying to parse all the called code
(main offenders are formattedRead and the File ctor)).
2013-04-19 22:49:56 +03:00
Vladimir Panteleev
16286c045b DDoc tweaks and fixes 2013-04-18 23:49:06 +00:00
Walter Bright
22165eec8d remove dead code 2013-03-28 15:57:57 -07:00
Vladimir Panteleev
eb1a477087 std.file: Document and test that copy clobbers 2013-03-11 05:14:35 +02:00
Vladimir Panteleev
7d35ad4953 std.file: Make rename clobber on Windows, adjust docs (Issue 5032) 2013-03-11 05:14:18 +02:00
Andrej Mitrovic
480b51c6a1 setTimes should throw FileException on Posix. 2013-02-10 04:19:39 +01:00
Andrej Mitrovic
6655cc1848 Update getTimes params and docs to reflect it supports directories. 2013-02-10 04:19:02 +01:00
Andrej Mitrovic
26edcdd305 Fixes Issue 7819 - setTimes should work on folders. 2013-02-10 04:02:07 +01:00
Dicebot
55e958a19d Removed unit-test of deprecated listDir 2013-01-26 20:02:15 +02:00
Dicebot
5523985f44 Fulfilled depreation promise for std.file functions (November 2012) 2013-01-26 17:37:35 +02:00
Andrej Mitrovic
aaa6854eb7 Fixes Issue 9373 - Add deprecation messages to Phobos. 2013-01-23 02:44:08 +01:00
H. S. Teoh
3d56ea1fa5 Complete the fix for issue 8302.
The original fix (e6621da899) missed the
second variant of std.file.dirEntries.
2013-01-03 21:21:39 -08:00
H. S. Teoh
655452e379 Remove stray // from ddoc. 2013-01-03 21:18:32 -08:00
Andrej Mitrovic
e6621da899 Fixes Issue 8302 - Document that std.file.dirEntries throws FileException on invalid dir. 2012-12-27 00:59:47 +01:00
k-hara
01df2f60be Remove redundant parenthesis for getters, and use assignment syntax for setters 2012-11-23 15:07:17 +09:00
Johannes Pfau
f989b219cc Get rid of transitional lfs API
Those kind of functions should be placed in druntime,
but the *64 (v) functions as a public interface are actually
deprecated and shouldn't be used anymore.

Druntime takes care that the normal stat, fopen, calls support
large files, if __USE_FILE_OFFSET64 is defined (which is what
the new C API does as well)

Note: It's actually important to use the functions from
core.sys.posix.stdio as the functions in core.stdc.stdio
are not large file aware. This is probably a bug in druntime.
2012-09-30 10:47:40 +02:00
jmdavis
723d93221b Deprecated std.file.listDir. 2012-07-15 14:15:40 -07:00
alexrp
adcac57526 Use errno instead of getErrno in Phobos. 2012-07-09 01:26:02 +02:00
Andrei Alexandrescu
cfeadbbe52 Directory iteration should not throw if some of the directory content is concurrently deleted. 2012-06-17 16:01:54 -05:00
Andrei Alexandrescu
c833d9e067 Add per-process deleteme file for testing. Otherwise make unittest -j may break because of simultaneous debug/release runs. 2012-06-17 15:20:17 -05:00
jmdavis
1a4e2892b6 Removed deprecated functions which were to be removed in May 2012. 2012-05-23 00:51:12 -07:00
Jonathan M Davis
cf2edb613a Merge pull request #513 from CyberShadow/std-file-windows-attributes
std.file: Use GetFileAttributesEx to query file attributes on Windows
2012-05-06 00:56:50 -07:00
Lars T. Kyllingstad
9522e7bc62 Removed superfluous 'static'
It was left over from an attempt to declare a WinAPI function inside a D
function (which unfortunately didn't work).
2012-05-03 01:52:30 +02:00
Lars T. Kyllingstad
b630804e81 Fix broken std.file.rmdirRecurse() unittest
'ln' gave an error, because "/tmp" is already included in deleteme.
2012-05-03 01:15:49 +02:00
Lars T. Kyllingstad
4204c32532 Removed the tempFile() unittest
This is mainly because it could be nice to use tempFile() in other
unittests.  Since tempFile() caches its return value, it would return
the test value ("/") for any other unittest that follows it.
Alternatively, if the other unittest(s) get run first, tempFile()'s
would fail.
2012-05-03 01:05:39 +02:00
Lars T. Kyllingstad
ccede5e9e6 Made tempPath() use Win API function GetTempPath() 2012-05-03 00:15:39 +02:00
Lars T. Kyllingstad
48cd943bf5 Added std.file.tempDir() 2012-05-01 14:04:39 +02:00
Vladimir Panteleev
e4a6e1b928 std.file: Disable Windows file creation time test
Deleting and immediately recreating a file doesn't seem to
always reset the file creation time.
2012-04-29 17:33:33 +03:00
Vladimir Panteleev
85c062fc70 Merge branch 'master' into std-file-windows-attributes
Conflicts:
	std/file.d
2012-04-29 17:32:05 +03:00
Kato Shoichi
022808fa68 Merge pull request #519 from NilsBossung/std.path_deprecations
std.path deprecations
2012-04-14 02:11:57 -07:00
Nils Boßung
2f247b28fa sep (deprecated) -> dirSeparator 2012-04-13 09:56:26 +02:00
Andrei Alexandrescu
2a8f28131c Fix hardcoded deleteme dir entry 2012-04-07 20:49:38 -05:00
Vladimir Panteleev
7901c9d19e std.file: Use GetFileAttributesEx to query file attributes
FindFirstFile and CreateFile may fail in certain circumstances when
GetFileAttributesEx would succeed - for example, if the user doesn't have
directory listing permissions on the object's containing directory.
2012-03-31 19:52:09 +03:00
Vladimir Panteleev
65bd541276 std.file: Fix time unittest when temp file exists before unittest runs 2012-03-31 19:37:46 +03:00
jmdavis
84340af538 Some fixes to std.file's documentation.
getcwd wasn't showing up in the docs when they were generated on Linux,
because the versioning for it wasn't done correctly.
2012-03-23 22:03:48 -07:00
Andrei Alexandrescu
5a7384f313 Merge pull request #486 from jmdavis/deprecated
Deprecation stuff for March
2012-03-22 22:50:55 -07:00
k-hara
348f68a159 Add @property more 2012-03-19 21:28:18 +09:00
jmdavis
7513e81c51 Merged in latest master.
Conflicts:
	std/file.d
2012-03-17 17:44:51 -07:00
Dmitry Olshansky
e25d430b99 revert changes to deprecated stuff 2012-03-15 17:36:14 +04:00
Dmitry Olshansky
48f5915677 fix Issue 7138 - Can't call array() on dirEntries
Alias this now appears to work properly, hence all tricks & problems
 with dual opDispatch are removed.
Also fixes:
Issue 7264 - Can't iterate result from 4-arg dirEntries as string
2012-03-15 13:29:45 +04:00
jmdavis
7a2da1a489 Removed deprecated functions for March from std.file.
It's primarily stuff which used std.date.
2012-03-10 13:53:37 -08:00
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