Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On POSIX std.file.copy was copying file times at second precision #7629

Merged
merged 1 commit into from
Sep 16, 2020

Conversation

n8sh
Copy link
Member

@n8sh n8sh commented Sep 12, 2020

No description provided.

@n8sh n8sh requested a review from CyberShadow as a code owner September 12, 2020 03:44
@dlang-bot
Copy link
Contributor

dlang-bot commented Sep 12, 2020

Thanks for your pull request, @n8sh!

Bugzilla references

Auto-close Bugzilla Severity Description
20370 normal On POSIX, std.file.copy only copies the file times at second precision

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "stable + phobos#7629"

@CyberShadow
Copy link
Member

It would be nice if this could use the same code as statTimeToStdTime, setTimes etc. to avoid duplication and support more platforms.

@n8sh n8sh force-pushed the issue-20370 branch 4 times, most recently from 2d3eb2b to 06ea9b3 Compare September 12, 2020 04:53
@n8sh n8sh requested a review from jmdavis as a code owner September 12, 2020 04:53
@@ -2523,7 +2523,7 @@ public:

version (StdDdoc)
{
private struct timespec {}
version (Windows) private struct timespec {}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is to avoid

/home/dtest/DAutoTest/work/tmp/ddoc_preprocessor_062038e10dce4e6eb0a29d181365ced6/std/file.d(1557): Error: cannot implicitly convert expression accessTime.toTimeSpec() of type std.datetime.systime.SysTime.timespec to core.sys.posix.signal.timespec

@n8sh
Copy link
Member Author

n8sh commented Sep 12, 2020

std/file.d(1512:6)[warn]: Public declaration 'setTimes' has no documented example.

Moved setTimesImpl after the documented tests to work around a Dscanner limitation but it makes the diff uglier (and IMO makes the source code less readable).

@dlang-bot dlang-bot merged commit b8e9e70 into dlang:stable Sep 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants