MoonlightSentinel
362e81830c
Fix 13541 - Replace usages of sysErrorString` with a helper function
...
`sysErrorString` throws an exception for unknown error codes (e.g. from
libraries using `SetLastError`) and hence could hide the actual error
that caused the call to `sysErrorString`.
The new helper function wraps the error code lookup and returns `Error X`
on failure.
2022-03-28 01:01:25 +02:00
MoonlightSentinel
304160f5af
Issue 13541 - Use wenforce
instead of enforce
+ sysErrorString
...
This ensures that the actual error message won't be suppressed when the
lookup error code => message fails. The exception will also be more
informative because `WindowsException` is explicitly intended for
Windows API errors.
2022-03-28 01:01:19 +02:00
Iain Buclaw
2b5ab004b2
Add preliminary support for GNU/Hurd
2022-03-22 14:11:33 +00:00
Luís Ferreira
5bc8b25944
std/file: use size_t instead of ulong for ReadFile on Windows
...
Since ReadFile requires an offset buffer and the maximum size is size_t.max, we
should offset with size_t to avoid overflow on dereferencing.
Signed-off-by: Luís Ferreira <contact@lsferreira.net>
2022-02-27 23:40:34 +00:00
dkorpel
b3b0e74152
Unblock "address of ref can be assigned to non-scope parameter"
2022-02-17 00:44:02 +00:00
Richard Andrew Cattermole
86c7d2ebeb
s/least/lest/
...
Co-authored-by: Vladimir Panteleev <CyberShadow@users.noreply.github.com>
2022-02-06 04:40:58 +13:00
rikki cattermole
0cdb54d03c
s/seperator/separator/
2022-02-06 04:39:07 +13:00
rikki cattermole
2ca70756c7
Missed some more whitespace.
2022-02-06 04:37:51 +13:00
rikki cattermole
c9cc092cb7
Remove trailing whitespace that was accidently added to std.file tempDir.
2022-02-06 04:30:51 +13:00
rikki cattermole
33e95aea02
Fix Issue 22738 - std.file.tempDir adds an addition / even when it already has one
2022-02-06 04:17:40 +13:00
Atila Neves
8a2bd81b39
Move checkedint out of experimental ( #8100 )
...
Move checkedint out of experimental
Signed-off-by: Razvan Nitu <RazvanN7@users.noreply.github.com>
Merged-on-behalf-of: Razvan Nitu <RazvanN7@users.noreply.github.com>
2022-01-25 00:17:24 +00:00
WebFreak001
dac59a4bde
add isSomeFiniteCharInputRange as simplification
...
combines the very common constraint
`isInputRange!R && !isInfinite!R && isSomeChar!(ElementEncodingType!R)`
and adds a bunch of documentation with examples for users to understand
it better. This should lower the neccessary needed technical insight to
read basic docs, especially std.path and std.file docs.
2022-01-15 18:38:52 +01:00
dkorpel
5d0cfcd13a
Fix scope
usage of SysTime/TimeZone
2021-11-18 23:49:51 +00:00
dkorpel
cd7389266e
Add explicit return
to inout
functions
2021-11-16 23:22:33 +00:00
Nathan Sashihara
2ba87d2ff7
Delete the bodies of a number of private wrapper functions in std.stdio and std.file
2021-10-28 06:10:01 -04:00
RazvanN7
85f426020a
Move import of dirSeparator to larger scope
2021-10-22 14:52:57 +03:00
Ryan Frame
02f4f148cf
Fix Issue 17488 - Add trailing slash to POSIX tempDir() to match Windows behaviour
2021-10-22 14:52:57 +03:00
Luís Ferreira
c047b238e3
std.file: don't initialize stat_t struct when running stat
...
Signed-off-by: Luís Ferreira <contact@lsferreira.net>
2021-09-04 20:05:44 +01:00
vladchicos
95329239c9
Windows readImpl is now marked @trusted
2021-08-02 17:55:56 +03:00
vladchicos
f3be11dc29
Fix Issue 16218 - Windows std.file.readImpl should be marked @system.
2021-08-01 14:59:39 +03:00
aG0aep6G
26bb8fcae4
add cast(void) to silence warnings in tests ( #8169 )
2021-07-20 08:19:00 +08:00
Luís Ferreira
808dca99af
file: document dirEntries as no garantee of sorted output
...
Some unittests should compare with a sorted array to be
correct.
Signed-off-by: Luís Ferreira <contact@lsferreira.net>
2021-06-20 10:52:39 +00:00
nordlow
61d60d2121
Annotate std/file.d to please dlang/dmd#12520
2021-05-20 13:14:21 +02:00
Atila Neves
771e5460b7
Make rmdir unittest @safe
2021-05-10 16:36:18 +02:00
Atila Neves
834ecfb609
Make mkdirRecurse unittest @safe
2021-05-10 16:35:37 +02:00
Atila Neves
f13839de44
Make unittest @safe
2021-05-10 16:34:33 +02:00
Atila Neves
e1a1c286b2
Make isFile unittest @safe
2021-05-10 16:30:50 +02:00
Atila Neves
cd16c4e741
Make DirEntry unittest @safe
2021-05-10 16:30:06 +02:00
Atila Neves
c2b6dbb0bb
Make timeLastModified
unittest @safe
2021-05-10 16:29:17 +02:00
Atila Neves
88808733f8
Make setTimes
unittest @safe
2021-05-10 16:27:55 +02:00
Atila Neves
8573787e1c
Make gettimes
unittest @safe
2021-05-10 16:26:46 +02:00
Atila Neves
09e1f93043
Make append
unittest @safe
2021-05-10 16:24:49 +02:00
Atila Neves
6dd5f57225
Make write
test @safe
2021-05-10 16:23:16 +02:00
Iain Buclaw
44f589b7b4
Revert "std.file docs: Tweak dirEntries examples"
2021-04-24 16:46:12 +02:00
Nick Treleaven
e5a6ba3714
fix missing doc example warning
...
std/file.d(4950:6)[warn]: Public declaration 'dirEntries' has no documented example.
2021-03-23 17:03:23 +00:00
Nick Treleaven
c47aa37f0e
Review tweaks
2021-03-23 13:09:08 +00:00
Nick Treleaven
77cdd7a980
fix style check
2021-03-22 18:46:22 +00:00
Nick Treleaven
a7cb83ee5f
std.file docs: Tweak dirEntries examples
...
Use selective imports for `listdir` example, not fully qualified calls.
Don't use `args`, use current directory for working runnable example.
Move parallel dmd example into a documented unittest. Use `pattern`
argument instead of filter & endsWith for simplicity. Note the
`listdir` example already uses `map`.
Only run these 'tests' for version(StdDdoc).
2021-03-22 13:51:20 +00:00
berni44
6f2a0934a7
Adapt imports of std.format to new structure of std.format.
2021-03-19 13:22:00 +01:00
Iain Buclaw
d2ec9db951
std.file: Use core.sys.darwin.mach.dyld module
2021-02-02 14:03:18 +01:00
Iain Buclaw
0df7288a50
std.file: Use core.sys.platform.sys.sysctl module
2021-02-02 14:03:18 +01:00
Iain Buclaw
c6c8b12852
Implement missing OpenBSD ports in phobos
2021-02-01 18:46:54 +01:00
Luís Ferreira
5ce45f91d2
file: make rmdirRecurse @safe
...
`rmdirRecurse` should be @safe as the cast(string) is safe in this context and
dirEntries, even though @system, it uses a RefCounted iterator which inside
will always make the reference deleted as the reference will never be passed
outside the function scope.
Signed-off-by: Luís Ferreira <contact@lsferreira.net>
2020-10-29 05:25:03 +01:00
Andrei Alexandrescu
c5e6213dde
Issue 21250 - dirEntries on non-existent directory causes assert error ( #7646 )
...
Issue 21250 - dirEntries on non-existent directory causes assert error
merged-on-behalf-of: Andrei Alexandrescu <andralex@users.noreply.github.com>
2020-10-02 16:49:09 +02:00
Nathan Sashihara
b8e9e70e90
Fix Issue 20370 - On POSIX, std.file.copy only copies the file times at second precision
2020-09-16 09:31:41 +02:00
Nils Lankila
e36b5aaba0
fix issue 21148, possible failure of CI when testing nano precision of file time stamps ( #7589 )
...
fix issue 21148, possible failure of CI when testing nano precision of file time stamps
merged-on-behalf-of: Nicholas Wilson <thewilsonator@users.noreply.github.com>
2020-08-13 10:12:08 +02:00
Euan Torano
8e03a95457
Fix issue 21113: Use sysctl for thisExePath on BSD.
2020-08-05 10:20:11 +02:00
Nathan Sashihara
453faadf5b
Replace is(Unqual!T == Unqual!U) with is(immutable T == immutable U) for speed & memory usage
2020-08-03 15:07:32 +02:00
Nathan Sashihara
dfb9099055
Fix Issue 20785 - std.file.setTimes: on macOS use setattrlist to avoid truncating timestamp precision to microseconds
2020-05-18 15:07:27 -07:00
Geod24
04f3979317
Replace 'Issue XXX' with Bugzilla links
...
Make the links clickable, as was done in the DMD repository.
Also avoids any ambiguity w.r.t. where the issue is stored.
2020-04-13 16:28:09 +09:00