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

[ipfs/go-ipfs-files] Possibility WriteTo to exist dir #28

Open
lasiar opened this issue Jul 20, 2021 · 3 comments
Open

[ipfs/go-ipfs-files] Possibility WriteTo to exist dir #28

lasiar opened this issue Jul 20, 2021 · 3 comments
Labels
need/triage Needs initial labeling and prioritization

Comments

@lasiar
Copy link

lasiar commented Jul 20, 2021

Maybe add to function WriteTo the feature for write to exist directory?

two choices:

  1. Change exist function:
// WriteTo writes the given node to the local filesystem at fpath.
func WriteTo(nd Node, fpath string, toExist bool) error {
	switch nd := nd.(type) {
	...
	case Directory:
		err := os.Mkdir(fpath, os.ModePerm)

		switch {
		case errors.Is(err, os.ErrExist):

		case err != nil:
			return err
		}
        ...
  1. Add a function with an additional argument ignoreExist or something else. Use exist fucntion WriteTo like a wrapper:
// WriteTo writes the given node to the local filesystem at fpath.
func WriteTo(nd Node, fpath string) error {
	return WriteToWithParams(nd, fpath, false)
}
@lasiar lasiar added the need/triage Needs initial labeling and prioritization label Jul 20, 2021
@welcome
Copy link

welcome bot commented Jul 20, 2021

Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review.
In the meantime, please double-check that you have provided all the necessary information to make this process easy! Any information that can help save additional round trips is useful! We currently aim to give initial feedback within two business days. If this does not happen, feel free to leave a comment.
Please keep an eye on how this issue will be labeled, as labels give an overview of priorities, assignments and additional actions requested by the maintainers:

  • "Priority" labels will show how urgent this is for the team.
  • "Status" labels will show if this is ready to be worked on, blocked, or in progress.
  • "Need" labels will indicate if additional input or analysis is required.

Finally, remember to use https://discuss.ipfs.io if you just need general support.

@hacdias hacdias changed the title Possibility WriteTo to exist dir [ipfs/go-ipfs-files] Possibility WriteTo to exist dir Jan 13, 2023
@welcome
Copy link

welcome bot commented Jan 13, 2023

Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review.
In the meantime, please double-check that you have provided all the necessary information to make this process easy! Any information that can help save additional round trips is useful! We currently aim to give initial feedback within two business days. If this does not happen, feel free to leave a comment.
Please keep an eye on how this issue will be labeled, as labels give an overview of priorities, assignments and additional actions requested by the maintainers:

  • "Priority" labels will show how urgent this is for the team.
  • "Status" labels will show if this is ready to be worked on, blocked, or in progress.
  • "Need" labels will indicate if additional input or analysis is required.

Finally, remember to use https://discuss.ipfs.io if you just need general support.

@hacdias hacdias transferred this issue from ipfs/go-ipfs-files Jan 13, 2023
Jorropo pushed a commit to ipfs/go-libipfs-rapide that referenced this issue Mar 23, 2023
Jorropo pushed a commit to ipfs/go-libipfs-rapide that referenced this issue Mar 23, 2023
Jorropo pushed a commit to ipfs/go-libipfs-rapide that referenced this issue Mar 23, 2023
Jorropo pushed a commit to ipfs/go-libipfs-rapide that referenced this issue Mar 23, 2023
@ofman
Copy link

ofman commented Dec 13, 2023

This is a similar issue I have posted here: #520

As a bonus some kind of return int64 progress would be great too please. Thanks! :)

P.S. For example func fileArchive(f files.Node, name string, archive bool, compression int) (io.ReadCloser, error) {} function has io.ReadCloser in kubo/core/commands/get.go. Also there are archive bool, compression int arguments which are not present in boxo/files/filewriter.go func WriteTo(nd Node, fpath string) error {} function which only returns error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need/triage Needs initial labeling and prioritization
Projects
None yet
Development

No branches or pull requests

2 participants