-
Notifications
You must be signed in to change notification settings - Fork 1
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
Make copying more predictable. #73
Conversation
Don't make the copy operation dependent on whether the target directory exists or not. Making it dependent has the following drawbacks: 1. the directory could be created outside of our control. 2. It's annoying in programs to test first whether the target exists. 3. There isn't a good way to copy the content of the source to the target if it already exists.
Also enabled some tests and fixed them. |
src/file.toit
Outdated
if not target-stat: | ||
mkdir target source-permissions | ||
if is-windows and source-permissions & SPECIAL-WINDOWS-PERMISSIONS_ != 0: | ||
// The Windows file attributes are not taking into account when creating a new directory. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
taking should be taken
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/file.toit
Outdated
out-writer := Writer out-stream | ||
try: | ||
while data := in-stream.read: | ||
out-writer.write data | ||
finally: | ||
in-stream.close | ||
out-writer.close | ||
if is-windows and (source-permissions & SPECIAL-WINDOWS-PERMISSIONS_) != 0: | ||
// The Windows file attributes are not taking into account when creating a new file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
Don't make the copy operation dependent on whether the target directory exists or not.
Making it dependent has the following drawbacks: