MonoTorrent how to process only specified files - c#

I want to download only specified file from torrent using MonoTorrent.
I use TorrentFile.Priority = Priority.DoNotDownload; , with this MonoTorrent doesn't download useless files for me, but MonoTorrent creates fake clear file, how can i avoid it? How can i avoid creation of fake mirror files for files with DoNowDownload priority?
Thanks!

The only way to avoid it is to exclude that file from initial torrent file. That is protocol specific problem - fake files used to count pices hash.

Related

SSIS - Move and open zip file / load xml file to the BD

first of all you're amazing.
About my problem, what i have to do, is:
I have a folder in the sftp with multiple files (zip).
What i need do do is, load those files from the sftp, one by one to a stagging folder, open them, inside they are 3 files, 2 pdf and one xml.
I need to upload the xml to the bd.
After that, based in one field of the xml (ExternalID) i need to move the file in some folder, that depends of the ExternalID, before i move the files, i need to zip all 3 files and name the zip with the ExternalID.
Anyone did something similar? Or some advises to do this?
Any help will be appreciated.
Regards.
SSIS doesn't support SFTP natively.
WinSCP (free of charge) could be handy.
Here is its link: SFTP Task for SSIS/SSDT

Best way to package large numbers of large files for download?

I have an ASP.NET website that stores large numbers of files such as videos. I want an easy way to allow the user to download all the files in a single package. I was thinking about creating ZIP files dynamically.
All the examples I have seen involve creating the file before it is downloaded but potentially terabytes of information will be downloaded and therefor the user will have a long wait. Apparently ZIP files store all the information regarding what is in the ZIP file at the end of the file.
My idea is to dynamically create the file as its downloaded. This way I could allow the user to click download. The download would start and not require any space on the server to be pre packaged as it would copy things over uncompressed sequentially. The final part of the file would contain the information on the contents of what has been downloaded.
Has anyone had any experience of this? Does anyone know a better way of doing this? At the moment I cant see any pre made utilities for doing this but I believe it will work. If it doesn't exist then i'm thinking that I will have to read the Zip file format specifications and write my own code... something that will take more time than I was intending to spend on this.
https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT

Zip files which are located in IsolatedStorage

My application need to download multiple files in Silverlight, and because I don't want to ask user multiple times for permission to save the files, I save the files in IsolatedStorage first and then I want to zip them all to a file and ask once for saving permission.
therefore I used SharpZipLib to zip multiple files which are located in IsolatedStorage, the problem is that SharpZipLib just accept file address as ZipEntery:
ZipEntry z= new ZipEntry(name);
and as you know cause the files are located in IsolatedStorage I don't have the address of them.
I saw sample on Create a Zip from/to a memory stream or byte array but I cant use it for multiple files.
Please help me to find a way to use SharpZipLib or introduce me another way to downloading multiple files without asking multiple times for permission.
The name in ZipEntry z= new ZipEntry(name); is a logical/relative name inside your zip, you can establish it any way you want.
So as long as you can re-open you IsoStorage files as a Stream, you should be able to use SharpZip.

File transactions issue - storing where each file come from?

I am creating an application that uses Quartz.NET to automatically download and upload files to various sources (HTTP, FTP and Network paths) based upon a regular exprsesion. Users can select multiple paths for each download and upload operation, so a typical job may be to download files from a http server, and also download from an ftp server, and upload all files to a network path.
Currently, I am downloading all files from all the download sources, and storing them in a folder (With the name of a folder being a GUID specific to that job). Then for the upload stage, it will simply read all files from that directory, and upload them to the path, which is great.
Problem is, for specific paths, the user may request these to be deleted after upload has completed, which is an issue as how can I find out where a file come from in a folder? I've been trying to think of ways around this, such as creating folders for each download path, but I'd need to check for duplicate names on download rather than upload, plus I'd need to merge both subfolders...etc!
Can anyone offer any ideas? Many thanks
Think about this in a object oriented manner.
Create a class like this
public class File
{
public string source;
public string destination;
public bool deleteSource; //if true delete the source after the copy
}
Now create a list of File classes like List<File> files and keep that as variable in your app.
Add objects to the list in the start and then traverse the list and copy / upload files. Check the deleteSource property and if it is true delete the file after the copy operation.
This is a basic idea and expand this class as required.
What I want to stress is that think of a problem in the object oriented way and start designing
When you download a file, can you create a separate text file that contains the source and destination paths? That way you can read in that mapping later and process them as necessary based on the source.

XCopy - Only grab files that are fully uploaded

I have an automated job that pulls files that are uploaded to our servers via a client facing site using xcopy.
Is there any way to only pull files that are fully uploaded?
I have thought about creating a second "inProcess" folder that will be used for uploading and then move those files once fully uploaded, but that still creates a window of time when the file is in transition to a "Done" folder...
Any thoughts?
use the .filepart extension for temporary files.
It's probably the most simple and clear way of doing this.
WinSCP does this.
You can upload an MD5 hash of the file and then upload the file and if the file uploaded doesn't match the MD5 then it's not finished (or if it takes to long, perhaps it didn't upload properly)
MD5 is often used to check the integrity of a file by creating a hash that represents the file. If the file varies at all, it will almost always (as in, basically never for our purposes) generate a different MD5 hash. The only reason a file would not match it's previously uploaded MD5 hash is if it wasn't finished or the MD5/file was corrupted on upload.
There is also this. but it's perl and from expert exchange (ick)

Categories

Resources