tags:

views:

105

answers:

1

Hello friends, I want to create torrent files using javascript. Torrent file creator currently available in a desktop application. May be it is possible in java as azurious, open source p2p client is written in java. Can somebody please give me guidelines to achieve it using javascript.

Thanks very much for any help

+2  A: 

Javascript is normally run within a browser in a "sandboxed" environment, where it can't for example create files. If you want to use Javascript in a standalone environment, such as jslibs, that's a very different proposition, and creating files becomes possible. So is your issue with Javascript per se, as your question and tagging indicate, or with the sandboxing browsers typically perform on it?

Alex Martelli
Hi,I am developing firefox extension. As a feature i want to provide torrent file creator. So i think, i will have all the privilages for creating files. can you please tell me where to get started i.e. creating files and all is ok but what actually present in torrent and how to implement it in javascript. Thanks
Xinus
I believe it's possible to write files in Firefox extensions, yes (never done it myself). Torrent files are complicated but well specified, see sections 6 and 7 in http://wiki.theory.org/BitTorrentSpecification#Metainfo_File_Structure ; I don't know of existing Javascript libraries to help with that. What information do you start from -- eg do you have the SHA1 values for the various pieces or do you have to compute them yourself?
Alex Martelli