Commit graph

619 commits

Author SHA1 Message Date
aG0aep6G
3debd58cb4 fix issue 21592 - two stack traces if high surrogate is printed 2021-03-03 13:46:29 +01:00
Hiroki Noda
11ec2bff64 Fix Issue 21627 - macOS: std.stdio.File.sync does not guarantee to be written to disk 2021-03-01 15:31:32 +01:00
Iain Buclaw
c6c8b12852 Implement missing OpenBSD ports in phobos 2021-02-01 18:46:54 +01:00
Martin Kinkelin
30fb34dab4 std.stdio: Adapt LockingBinaryWriter to emplace() in druntime 2021-01-18 14:20:31 +01:00
Nathan Sashihara
c16bb67bb5 Fix Issue 21523 - Microsoft Windows std.stdio.File.lock(), tryLock(), unlock(): do not allocate memory for error messages when they are not needed 2021-01-04 04:55:24 +01:00
aG0aep6G
31df240930 fix issue 21493 - Documentation broken hyperlink std.stdio 2020-12-20 13:24:16 +01:00
Iain Buclaw
2c06601417 std.stdio: Fix typo in getdelim deprecation message 2020-12-02 13:23:52 +01:00
Iain Buclaw
2db474be28 std.stdio: Deprecate extern(C) getdelim
The publicly available `extern(C)` binding for `getdelim` in `std.stdio`
has been deprecated. Any code that still needs it can import the symbol
from `core.sys.posix.stdio` in druntime instead.
2020-12-02 06:19:53 +01:00
Iain Buclaw
11f075500e std.stdio: Replace version(HAS_GETDELIM) with __traits(compiles, getdelim) 2020-12-01 15:38:45 +01:00
Iain Buclaw
9c7974a3db std.stdio: Merge readlnImpl implementations into one function 2020-12-01 13:50:27 +01:00
Iain Buclaw
a2c407b42c std.stdio: Deprecate extern(C) getline
The publicly available `extern(C)` binding for `getline` in `std.stdio` has
been deprecated. Any code that still needs it can import the symbol from
`core.sys.posix.stdio` in druntime instead.
2020-12-01 11:59:05 +01:00
Luís Ferreira
3ea61977ec stdio: optimize readln algorithm for non-char type
Instead of using buf.length = 0, use buf = buf[0..0] slice technique to clean
the array and reuse, if possible, the buffer to reduce GC allocations.

Signed-off-by: Luís Ferreira <contact@lsferreira.net>
2020-10-28 15:09:58 +01:00
Johan Engelen
dfd45c0ac1 std.stdio: move std.process import inside unittest
This moves the std.process import inside the unittest. The import is not used elsewhere, and so is unnecessary for non-unittest builds. This greatly speeds up importing std.stdio. (In a simple testcase, more than 90% of the import time of std.stdio was spent on std.process)

I've tried to keep whitespace changes to a minimum, while keeping the code readable.
2020-10-23 16:58:25 +02:00
Rainer Schuetze
e74cd7f553 Keep a copy of the return value of setlocale(), it can become invalid 2020-10-13 11:28:16 +02:00
aG0aep6G
e7e75cf234 add the original test case of issue 18789
... to ensure that it doesn't throw any exceptions like it used to.
2020-09-21 21:19:06 +02:00
aG0aep6G
4b416afe16 ditch the ccs flag; set locale instead 2020-09-21 21:07:29 +02:00
aG0aep6G
b394e321be refactor: merge tests 2020-09-21 21:05:47 +02:00
aG0aep6G
41f78fc1e1 fix conversion from wchar to wchar_t in LockingTextWriter.put
This fixes issue 18789.
2020-09-21 21:05:44 +02:00
aG0aep6G
ece1672ae8 fix conversion from char to wchar_t in LockingTextWriter.put 2020-09-21 21:05:30 +02:00
aG0aep6G
3754e92341 fix issue 18801 - std.stdio.File doesn't work with MSVCRT's UTF-8 mode 2020-09-17 11:42:33 +02:00
canopyofstars
90c62c6c4e
Fix issue 7033: File.rawWrite is slow on Windows (#7590)
Fix issue 7033: File.rawWrite is slow on Windows
merged-on-behalf-of: Steven Schveighoffer <schveiguy@users.noreply.github.com>
2020-08-15 12:07:38 +02:00
Andrei Alexandrescu
42138c021c
Replace Unqual-based idiom with immutable-based idiom (#7576)
Replace Unqual-based idiom with immutable-based idiom
merged-on-behalf-of: Andrei Alexandrescu <andralex@users.noreply.github.com>
2020-08-04 04:32:14 +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
Nick Treleaven
73e71219c0 [std.stdio.writeln] Simplify static checks for string specialization
Checking for a slice or static array whose first element converts to
const(char) is enough; it rules out aggregates, enums, null.
2020-06-03 16:11:53 +01:00
The Dlang Bot
5825b7ad7d
Merge pull request #7505 from welkam/patch-1
Size(). Make description more clear and add example
merged-on-behalf-of: Nicholas Wilson <thewilsonator@users.noreply.github.com>
2020-06-03 07:55:57 +02:00
welkam
70d61e22ee removed deleteme and improved description 2020-06-02 22:43:48 +03:00
The Dlang Bot
ec600564ac
Merge pull request #7500 from denizzzka/generic_FSChar
alias FSChar = char for a wider range of platforms
merged-on-behalf-of: Nathan Sashihara <n8sh@users.noreply.github.com>
2020-05-31 06:17:21 +02:00
wolframw
372b20ca17 fix issue 20882 - Outdated examples in the documentation (std.stdio) 2020-05-30 15:50:59 +02:00
welkam
05f46a852d changed tabs to spaces 2020-05-29 17:15:40 +03:00
welkam
9fa355c26a
Size(). Make description more clear and add example
what title says
2020-05-29 16:39:36 +03:00
Denis Feklushkin
dc144b83f6 Set alias FSChar for Windows and all other OSes 2020-05-28 23:13:54 +07:00
Denis Feklushkin
e7e4a4b3a8 FSChar = char for a wider range of platforms 2020-05-28 05:03:54 +07:00
wolframw
2c80a0f981 fix refs to core.stdc.stdio.stdin/stdout/stderr 2020-05-22 02:09:20 +02: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
H Paterson
4e1752e4ff
Improve std.stdio.File documentation (#7421)
Improve File.name documentation.
2020-03-21 15:29:51 -04:00
Jacob Carlborg
280f3fce87 Disable most of std.process on iOS derived platforms
A process does not have permission to create new processes on
iOS derived platforms.
2020-03-03 12:51:07 +01:00
Jacob Carlborg
84a53ed38a Add missing IO for iOS derived platforms 2020-03-03 12:51:07 +01:00
Martin Nowak
73aa224d60 Merge remote-tracking branch 'upstream/master' into stable 2020-02-24 09:13:22 +01:00
Hiroki Noda
902e49bb66 Fix Issue 20585 - std.stdio.File.open() failure leaves File in invalid
state
2020-02-18 02:21:14 +09:00
MoonlightSentinel
4af7a4353c
Removed deprecated By(Line|Chunk|Record) from std.stdio 2020-01-28 17:29:00 +01:00
Alexandru Militaru
bb62aaca3d Replaced version (unittest) with version (StdUnittest) to avoid unnecessary overhead when compiling with -unittest 2020-01-19 14:05:17 +02:00
Bernhard Seckinger
3271984e52 Fix partially Issue 11809 - unit tests leave behind temporary files 2019-11-13 08:08:13 +01:00
Geod24
20219915b4 Make std.stdio's seek function more restrictive
Value '3' can be a valid value on Linux (`SEEK_DATA`, since 3.18).
The support depends on the kernel version and the libc used.
Hence, make the check common to all platform / runtime.
2019-10-24 15:20:47 +09:00
Vladimir Panteleev
5cb4d927e5 std.stdio: Fix failing unittest with no autodecode
The code compiled and ran, but behaved differently.

The silent breakage was due to the implicit conversion of char to
dchar. Forbidding such conversions would prevent the silent breakage.
2019-08-15 11:59:21 +00:00
Vladimir Panteleev
a15af9cf55
Fix Issue 20129 - AA require with File values gives "Error: return expression expected" in object.d 2019-08-13 20:31:12 +00:00
Charles McAnany
41f28f6270 Clarify that buf can be shortened in readln (#7125)
Clarify that buf can be shortened in readln
merged-on-behalf-of: Vladimir Panteleev <CyberShadow@users.noreply.github.com>
2019-08-06 20:30:04 +02:00
Francesco Mecca
d6cd71bf7b use waitpid for unittest 2019-07-15 18:18:11 +02:00
Vladimir Panteleev
6197b533ed
Fix Issue 19980 - File.byLine skips first line in some cases when used inside map!() 2019-06-17 23:53:04 +00:00
Sebastian Wilzbach
1386fa253f Use selective top-level module imports in std.{stdio,string} 2019-05-23 10:32:49 +02:00
Bastiaan Veelo
a2aa3d3590 Special case enforce against issue 19797, documentation. 2019-04-14 01:04:17 +02:00