Вот два общих решения для строго типизированных списков, которые возвратят все уникальные комбинации членов списка (если вы можете решить это с помощью более простого кода, я приветствую вас):
// Recursive
public static List<List<T>> GetAllCombos<T>(List<T> list)
{
List<List<T>> result = new List<List<T>>();
// head
result.Add(new List<T>());
result.Last().Add(list[0]);
if (list.Count == 1)
return result;
// tail
List<List<T>> tailCombos = GetAllCombos(list.Skip(1).ToList());
tailCombos.ForEach(combo =>
{
result.Add(new List<T>(combo));
combo.Add(list[0]);
result.Add(new List<T>(combo));
});
return result;
}
// Iterative, using 'i' as bitmask to choose each combo members
public static List<List<T>> GetAllCombos<T>(List<T> list)
{
int comboCount = (int) Math.Pow(2, list.Count) - 1;
List<List<T>> result = new List<List<T>>();
for (int i = 1; i < comboCount + 1; i++)
{
// make each combo here
result.Add(new List<T>());
for (int j = 0; j < list.Count; j++)
{
if ((i >> j) % 2 != 0)
result.Last().Add(list[j]);
}
}
return result;
}
// Example usage
List<List<int>> combos = GetAllCombos(new int[] { 1, 2, 3 }.ToList());
Install curlftpfs (if on Windows, use cygwin) # Create local mount path mkdir -p /mnt/myftp # Mount the destination ftp site using curlftpfs curlftpfs -o allow_other ftp://myusername:mypassword@ftp.mydomain.com /mnt/myftp # rsync inplace using append option # use a long timeout value as the first long phase # (the inplace comparison) takes a while rsync -rzvvv --inplace --append --progress --stats --timeout=7200 /mnt/myftp/path/to/source/file.log /path/to/local/destination/file.log # When you need to umount the ftp site sudo umount myftp # You can also mount from /etc/fstab by appending the following line # curlftpfs#myusername:mypassword@ftp.mydomain.com /mnt/myftp fuse allow_other,rw,user,noauto 0 0 # References: # http://linux.byexamples.com/archives/344/mounting-ftp-host-to-local-directory-on-top-of-fuse/ # http://lists.samba.org/archive/rsync/2007-May/017762.html
Разве " резюме не загрузило бы" работу для Вашего случая?
Просто притворяются, что Ваша передача была прервана в прошлый раз и загрузка перезапуска с того, где Вы останавливаетесь
Я думаю, что Вы пытаетесь вытащить rsync функции из ftp, и он не собирается работать легко. Я рекомендовал бы чистое rsync решение.