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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding file append #48

Closed
ikhsan opened this issue Jan 15, 2018 · 2 comments 路 Fixed by #49
Closed

Adding file append #48

ikhsan opened this issue Jan 15, 2018 · 2 comments 路 Fixed by #49

Comments

@ikhsan
Copy link
Contributor

ikhsan commented Jan 15, 2018

Thanks for Files! I wrote a script with it for a database validation task at work, had a very nice warm feeling being able to write Swift scripts 馃槃

I have a suggestion though, I was a bit surprised that Files's writes only override but no support for appending. Can we have file append? Similar to >> in bash.

I'm happy to create a PR, but I want to make sure if this sounds like a good addition. I'm thinking to add new methods func append(data: Data) throws and its string counterpart. Or, we could change write to func write(data: Data, shouldAppend: Bool = false) throws. I prefer the former though, let me know what you think.

@JohnSundell
Copy link
Owner

Hi @ikhsan! 馃憢 Awesome to hear that you're getting into Swift scripting 馃憤 I agree, let's do the former:

func append(data: Data) throws

Think it would be a great addition to the framework, happy to accept a PR adding it 馃檪

@ikhsan
Copy link
Contributor Author

ikhsan commented Jan 16, 2018

Awesome stuff! 馃憣

As the PR is ready #49, I'm closing this issue.

@ikhsan ikhsan closed this as completed Jan 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants