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

need a example about seeding files directly from the filesystem #300

Closed
TongxiJi opened this issue Dec 21, 2018 · 10 comments
Closed

need a example about seeding files directly from the filesystem #300

TongxiJi opened this issue Dec 21, 2018 · 10 comments

Comments

@TongxiJi
Copy link

No description provided.

@TongxiJi
Copy link
Author

TongxiJi commented Dec 21, 2018

I just added a new function and tried successfully.

But we'd like to have an official example.

func (cl *Client) AddTorrentWithStorage(mi *metainfo.MetaInfo,storage storage.ClientImpl) (T *Torrent, err error) {
	tc := TorrentSpecFromMetaInfo(mi)
	tc.Storage = storage
	T, _, err = cl.AddTorrentSpec(tc)

	var ss []string
	slices.MakeInto(&ss, mi.Nodes)
	cl.AddDHTNodes(ss)
	return
}

@TongxiJi

This comment has been minimized.

@anacrolix

This comment has been minimized.

@anacrolix
Copy link
Owner

To clarify, a cmd that does this will generate an info from a file or directory, emit the info in the form of a hash or magnet link, and then seed it.

@TongxiJi
Copy link
Author

@anacrolix I generate an info from a file or directory first,then i do as torrent downloading and replace function “AddTorrent” to “AddTorrentWithStorage”.
I've test pass dir without read-only file.

@TongxiJi
Copy link
Author

@anacrolix And test env os is windows10 64bit.

@akghka
Copy link

akghka commented May 14, 2021

I don't understand how to seedingd directly from the filesystem.What should i do?Should I impl my own storage

@anacrolix
Copy link
Owner

@akghka do you want to ask this on Discussions?

@anacrolix
Copy link
Owner

See #556.

@anacrolix
Copy link
Owner

The linked-to discussion addresses this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants