mirror of
https://github.com/dlang/phobos.git
synced 2025-04-27 05:30:33 +03:00
Fix Issue 23683 - std.file.setTimes requests more permissions than needed
This commit is contained in:
parent
73ba45329e
commit
42aa5809a5
1 changed files with 11 additions and 1 deletions
12
std/file.d
12
std/file.d
|
@ -1575,7 +1575,7 @@ private void setTimesImpl(scope const(char)[] names, scope const(FSChar)* namez,
|
|||
const ta = SysTimeToFILETIME(accessTime);
|
||||
const tm = SysTimeToFILETIME(modificationTime);
|
||||
alias defaults =
|
||||
AliasSeq!(GENERIC_WRITE,
|
||||
AliasSeq!(FILE_WRITE_ATTRIBUTES,
|
||||
0,
|
||||
null,
|
||||
OPEN_EXISTING,
|
||||
|
@ -1664,6 +1664,16 @@ private void setTimesImpl(scope const(char)[] names, scope const(FSChar)* namez,
|
|||
rmdirRecurse(newdir);
|
||||
}
|
||||
|
||||
// https://issues.dlang.org/show_bug.cgi?id=23683
|
||||
@safe unittest
|
||||
{
|
||||
scope(exit) deleteme.remove;
|
||||
import std.stdio : File;
|
||||
auto f = File(deleteme, "wb");
|
||||
SysTime time = SysTime(DateTime(2018, 10, 4, 0, 0, 30));
|
||||
setTimes(deleteme, time, time);
|
||||
}
|
||||
|
||||
/++
|
||||
Returns the time that the given file was last modified.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue