I want to include that the main thing that made me come up with this was the limited way emule translates its very own collection file that it has implemented. It does not allow the ability to add more information to the links such as the full hash set, and even if you add the information to the links manually in the collection file, when you load the file into emule it ignores the extra information in the link such as the full hash set.
And most of all I want it to be made so that it is easily adopted by all other ed2k compatible clients.
Here is a layout of the protocol that could be used for such a file system:
Before reading the file it will always be decompressed first if it is compressed.
A compressed ed2k file will have a line added to the top of the file containing text that will denote that the file is compressed and what compression method was used, so that it may be detected as compressed and able to be decompressed with whatever method that was used to compress it. When decompressing the file the first line will be read to determine the compression method used, then the plain text ed2k file will be extracted from the compression archive to be used.
A compressed ed2k file will simply be an ed2k file that has been added to a compressed archive file with the extension of that archive file also using *.ed2k. After the file is made a line will be added to the top of the file denoting that it is a compressed file and what compression method was used.
If you wanted to manually compress a plain text ed2k file, all you would need to do is compress it with a compression method that can be decompressed by the desired clients, then change the extension of the archive file to ed2k (or just add .ed2k at the end of the file name after the extension) and then add a line to the begging of the compressed file in the same way as the examples given below.
Example of compressed ed2k archive file with ZIP compression:
-c zip Here is where the compressed archive data line(s) would be.
Example of compressed ed2k archive file with RAR compression:
-c rar Here is where the compressed archive data line(s) would be.
Example of compressed ed2k archive file with 7-Zip compression:
-c 7z Here is where the compressed archive data line(s) would be.
The files may also be manually decompressed by simply extracting the ed2k file out of the archive file. The added line to the archive file does not change the functionality of any current archivers that I know of, so removing the added line is not required to decompress the ed2k files from most archive file formats.
More then one compression format may be used for future support. Compression formats that are not supported by clients would need to be decompressed into plain text format with another utility before that client would be able to use the file, but this would be necessary to make the compression format possibly upgradeable in the future.
When not compressed the file would be in plain text format.
All spaces and tabs in the file that are in front of or behind a line will be striped away when the file is processed like most other code formats are handled.
Lines that begin with anything that is not recognized by the client will be ignored.
All lines that begin with a ; will also be ignored by clients.
All abilitys would be available and backwards compatible in plain text format.
No line but a line with only an ed2k link on it may begin with:
ed2k://
In plain text format the first line may never begin with:
-c
All the information that can be added to a ed2k link may be included with the link in the ed2k file and may be used by the client when the information is read from the file if supported by the client.
A directory structure may be added to each link but is not required to make the file nor required to read the file unless you want to use the directory structure.
Here is an example of the directory structure format with 10 ed2k example links added to it:
ed2k://|file|FileName1|FileSize|FileID|h=AICHHash|p=CompleteHashSet|/ <f="Folder Name"> ed2k://|file|FileName2|FileSize|FileID|h=AICHHash|p=CompleteHashSet|/ ed2k://|file|FileName3|FileSize|FileID|h=AICHHash|p=CompleteHashSet|/ ed2k://|file|FileName4|FileSize|FileID|h=AICHHash|p=CompleteHashSet|/ <f="SubFolder Name"> ed2k://|file|FileName5|FileSize|FileID|h=AICHHash|p=CompleteHashSet|/ <f="SubSubFolder Name"> ed2k://|file|FileName6|FileSize|FileID|h=AICHHash|p=CompleteHashSet|/ ed2k://|file|FileName7|FileSize|FileID|h=AICHHash|p=CompleteHashSet|/ </f> </f> <f="Another SubFolder Name"> ed2k://|file|FileName8|FileSize|FileID|h=AICHHash|p=CompleteHashSet|/ ed2k://|file|FileName9|FileSize|FileID|h=AICHHash|p=CompleteHashSet|/ </f> </f> <f="Another Folder Name"> ed2k://|file|FileName10|FileSize|FileID|h=AICHHash|p=CompleteHashSet|/ </f>
As you can see the first ed2k link in this example is not inside of the file tree and would not be placed inside of a created folder.
The folders would be created if not already present inside of your main download folder after the files have completed downloading, so that the files could be placed inside of the created folders.
I think if you want to add directory structure support to the client you may want to add the ability to add a download destination to each file instead of just to each category. If a file specific download destination is set it should supersede the category download destination. Personally I think this ability to add a per file download destination independent of categories should be implemented regardless of how it may be used.
The author of the file may sign the file as well as add a name, comment, and title to the file.
The signature, name, comment, and title will be placed on a single line each.
The signature will be a hash that is encrypted by your private key.
This will be a hash of the entire contents of the file with the line that the signature is on excluded. This would make it so that anyone with your public key would be able to know for sure that the contents of the file had not been tampered with before they received it, as well as be able to know that this file did in fact come from you.
Here is an example of the signature, name, title, & comment line:
-signature EncryptedHashOfFileContents -author TheGivenAuthorName -title This would be the author's given title of the ed2k file. -comment You would be able to place a limited length comment here.
The limited length of the comment would depend on how much the reading client would display and would cut off any excess at the end of the comment.
This file system could easily be adopted by all other ed2k clients. Each author of each ed2k client could easily decide for themselves what features they want to add support for.
If an ed2k client wants to just add the limited most basic support they could just add support for stripping away or ignoring all spaces and tabs in the file that are in front of or behind a line, and then only reading lines that begin with:
ed2k://
When the file is read by the client then all of the information in the link(s) should be used such as the full hash set if present, just as if you had manually copy and pasted the link into the ed2k client.
If other ed2k clients don't even want to add support for compression they would not need to add it since no links would be found in such a file if read and would simply be skipped.
This would be very simple to implement for other clients that just want basic reading support.
I am going to add a bunch of example files below to better illustrate the file format.
Here is an example of a full ed2k file with added functionality such as signature and a directory structure:
-signature EncryptedHashOfFileContents -author TheGivenAuthorName -title This would be the author's given title of the ed2k file. -comment You would be able to place a limited length comment here. ed2k://|file|FileName1|FileSize|FileID|h=AICHHash|p=CompleteHashSet|/ <f="Folder Name"> ed2k://|file|FileName2|FileSize|FileID|h=AICHHash|p=CompleteHashSet|/ ed2k://|file|FileName3|FileSize|FileID|h=AICHHash|p=CompleteHashSet|/ ed2k://|file|FileName4|FileSize|FileID|h=AICHHash|p=CompleteHashSet|/ <f="SubFolder Name"> ed2k://|file|FileName5|FileSize|FileID|h=AICHHash|p=CompleteHashSet|/ <f="SubSubFolder Name"> ed2k://|file|FileName6|FileSize|FileID|h=AICHHash|p=CompleteHashSet|/ ed2k://|file|FileName7|FileSize|FileID|h=AICHHash|p=CompleteHashSet|/ </f> </f> <f="Another SubFolder Name"> ed2k://|file|FileName8|FileSize|FileID|h=AICHHash|p=CompleteHashSet|/ ed2k://|file|FileName9|FileSize|FileID|h=AICHHash|p=CompleteHashSet|/ </f> </f> <f="Another Folder Name"> ed2k://|file|FileName10|FileSize|FileID|h=AICHHash|p=CompleteHashSet|/ </f>
Here is an example of a full ed2k file without a directory structure added:
-signature EncryptedHashOfFileContents -author TheGivenAuthorName -title This would be the author's given title of the ed2k file. -comment You would be able to place a limited length comment here. ed2k://|file|FileName1|FileSize|FileID|h=AICHHash|p=CompleteHashSet|/ ed2k://|file|FileName2|FileSize|FileID|h=AICHHash|p=CompleteHashSet|/ ed2k://|file|FileName3|FileSize|FileID|h=AICHHash|p=CompleteHashSet|/ ed2k://|file|FileName4|FileSize|FileID|h=AICHHash|p=CompleteHashSet|/ ed2k://|file|FileName5|FileSize|FileID|h=AICHHash|p=CompleteHashSet|/ ed2k://|file|FileName6|FileSize|FileID|h=AICHHash|p=CompleteHashSet|/ ed2k://|file|FileName7|FileSize|FileID|h=AICHHash|p=CompleteHashSet|/ ed2k://|file|FileName8|FileSize|FileID|h=AICHHash|p=CompleteHashSet|/ ed2k://|file|FileName9|FileSize|FileID|h=AICHHash|p=CompleteHashSet|/ ed2k://|file|FileName10|FileSize|FileID|h=AICHHash|p=CompleteHashSet|/
Here is an example of a full ed2k file without any functionality added:
ed2k://|file|FileName1|FileSize|FileID|h=AICHHash|p=CompleteHashSet|/ ed2k://|file|FileName2|FileSize|FileID|h=AICHHash|p=CompleteHashSet|/ ed2k://|file|FileName3|FileSize|FileID|h=AICHHash|p=CompleteHashSet|/ ed2k://|file|FileName4|FileSize|FileID|h=AICHHash|p=CompleteHashSet|/ ed2k://|file|FileName5|FileSize|FileID|h=AICHHash|p=CompleteHashSet|/ ed2k://|file|FileName6|FileSize|FileID|h=AICHHash|p=CompleteHashSet|/ ed2k://|file|FileName7|FileSize|FileID|h=AICHHash|p=CompleteHashSet|/ ed2k://|file|FileName8|FileSize|FileID|h=AICHHash|p=CompleteHashSet|/ ed2k://|file|FileName9|FileSize|FileID|h=AICHHash|p=CompleteHashSet|/ ed2k://|file|FileName10|FileSize|FileID|h=AICHHash|p=CompleteHashSet|/
This post has been edited by BigRedBrent: 14 August 2007 - 10:55 PM