From my side, I suggest you two things which can help you but it depends : 1. You can try to buy an adaptor LaptopHD -> IDE for Desktop, it is not very expensive but need to know the provider as it is very hard to find. 2. You can try to download a Linux LiveCD : * http://ophcrack.sourceforge.net/download.php?type=livecd[^] * or http://www.slax.org/get_slax.php[^] These two distro mount automatically ntfs partition and if connected to the network can get connection automatically too. You just need to burn on a CD and boot from it. Cheers,
vantoora
Posts
-
Boot CD that can copy an HD from an unbootable system? -
recursive folder compareSo finally here is my final code which is what i expect to have (no lack of memory usage nor cpu usage) :
static void Main(string[] args) {
/// args[0] : source server
/// args[1] : destination server
///
CombinePaths(args[0], args[1]);
}private static void CombinePaths(string S, string D) {
int indexRoot = S.Length + 1;
var stack = new Stack<string>();
stack.Push(S);
while (stack.Count > 0) {
string dir = stack.Pop();
try {
foreach (string sd in Directory.GetDirectories(dir)) {
stack.Push(sd);
// Console.WriteLine(dn.ToString());
string foldername = sd.Substring(indexRoot);
string combination = Path.Combine(D, foldername);
if (!Directory.Exists(combination))
{
// Console.WriteLine(combination);
Console.WriteLine(sd);
}
}
}
catch (UnauthorizedAccessException e)
{
Log.Add(e.Message);
}
}
}The principle is this : the program iterate all directories inside the root folder, then parse the length to the subdirectories that it combine with the destination server, to finally check if the folder just listed from the source server exist in the destination server. (I think it some kind of "dir /s" in DOS Command). It is what i expect to have during 9 days but i still need help to optimize my apps. As I've just count now, some of my root folder contains 2,000,000 - 3,000,000 folders inside. So I do not want to iterate all of this but i need to stop at level ten (10) or twenty (20), means i need to specify a deep level of iteration but i don't know how to make it by using this stack<> techniques. Any suggestions are welcome. Thanks for all!
-
recursive folder compareThanks for your prompt reply but i think i found another idea. That's getting the list of the first server and try to find it into the second server. If the folder exist, do not care, otherwise log the foldername.fullpath. for example, suppose i have this : S1 : c:\rootfolder_S1\folder1\folder2\folder3 S2 : c:\rootfolder_S2\folder1\folder2\folder3 beginning from c:\rootfolder - get list of folders for one level i got : folder1 - used Path.GetFileNameWithoutExtension(dir) and got : folder1 - use the Path.Combine(S2, foldername) and got : c:\rootfolder_S2\folder1 It's ok and very nice algorithm. But my problem, now, is how can i use this if recursing folders in S1. Using Path.GetFileNameWithoutExtension(dir) will get only the last name of the folder and if combining with S2, will got error or something else. What i'm going to try is check the size of S1 (rootfolder only), and then use the substring(index) before combining with S2, but how can i get the size or lenght of S1. S1 : c:\rootfolder -> should have 13 characters. This is my sample code :
static void Main(string[] args)
{
CombinePaths(args[0], args[1]);
}private static void CombinePaths(string p1, string p2)
{
string[] dirs = Directory.GetDirectories(p1);
foreach (string dir in dirs)
{
try
{
int index = dir.LastIndexOf("\\") + 1;
string foldername = dir.Substring(index);
string combination = Path.Combine(p2, foldername);
if (!Directory.Exists(combination))
{
Console.WriteLine(dir);
}
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
Console.WriteLine(Path.GetFileNameWithoutExtension(dir));
// RecurseFolder(dir,dirs);
}
}this is what i have for now. I'll reply back if found how to have the number of the character of the source string. Maybe not yet very clear my code but think it is still a draft code. See you later.
-
recursive folder compareDear folks, I have many folders to compare but I don't know how I can make a comparison between them without lacking for memory usage. I explain : I have two servers with around 10TB of data each. I use "xcopy" command (on Windows-DOS) for making the copy incrementaly. The first server have datas changing everytime but the other is just for mirroring. Sometimes I need to check if every folders between the two servers are the same (just the folder). I used IEnumerable/List<>... to do the work but consume CPU usage or memory usage. The structure of the folders are the same so what I need is to compare each structure only. If anybody have an idea (with a sample code or just the algorithm or pseudo-code) I should appreciate it. Many thanks to you all.
-
Personal Financial Management Software RecommendationBonjour to all, Have you ever thinking about Quicken ? I used Microsoft Money too before but this one seems better than Microsoft Money. Gnu Cash also is good as suggested sooner if you are using Linux OS. Wish this help you. Cheers :-\
-
Save/Export Listbox Content to a file !?Thanks for your reply but it does not what I expect to have. Maybe my question is not quiet clear so I'll explain first what I want to have. So I have one listbox that I populate with a result of a calculation. Let's say the listbox contains 100 items. What I need is to save those list items into a file (maybe I want them later even if I already closed the program for another process). What you showed me is just the way how to write into a file but not how to retrieve all value of the list and save them into a file. This is what I want. But, fortunately, I know now how to save the listbox contents : 1. I count the number of items : listbox1.Items.Count; 2. recursively set each Items selected : listbox1.SetSelected(i, true); and StreamWriter each selected Items directly. for example : int number = listbox1.Items.Count; StreamWriter sw = new StreamWriter(@"C:\list.csv"); for (int i = 0; i < number; i++) { listbox1.SetSelected(i, true); sw.WriteLine(listbox1.SelectedItems[i].ToString()); } sw.Close(); Hope this will help someone else. (of course you can personalize it like adding savefiledialog...) Cheers, :-D
-
Save/Export Listbox Content to a file !?Hi Folks, I made one prog with C# to list some query in a listbox control, and I want it to be saved to a file like *.txt or *.csv or ... anyway I just want to save my listbox content but I don't know how if someone can give me some tips. thanks in advance for all and have a nice day.
-
How to write log file directly without annoying virtual memoryYes, you're right. I'm going to change my app now. It's more quick than before after sorting the file list with just a few number of files. Many thanks for your help ;-)
-
How to write log file directly without annoying virtual memoryFirstly, thanks for your prompt reply. [Dave Kreskowiak] Yeah this is what I want I think write the information directly as I find it, but I don't know how to make it. [Luc Pattyn] So you mean that I'll always get into trouble everytime I make my comparison ? Let me explain to you first what my program do. I have two servers with disk capacity around 7 To each. The first one change everytime, 'cause it is like a transaction server, and second one is just for backing up the first one. Let's say transaction server = 1A and backup server = 1B Once someone made a transaction into 1A, it should be backed up to 1B but no need to delete files from 1B directly. Need to wait about two weeks and after that I should make a purge. So my application is about purging files. Means that it compares first all files of the two servers and then lists those files before delete. It's at this level I'm into a trouble, making the comparison and then list all files. So which solution should I adopt correctly ? Writing files directly inside a text file (by splitting if up to a specific size) or using a dictionnary or list... something like that. Or if have other solution I would appreciate it. for information: my app is made with C# .NET 3.5 Thank you so much
-
How to write log file directly without annoying virtual memoryDear all, I developed one application which collect the list of files in a directory after a comparison. At the beginning I add the result into a datagridview but it seems I take too much virtual memory, for around 5 millions of file comparison. I tried to write the list inside a text file but still the same problem. So what I want to have is that how/what shoud I do to write the list of files after comparison directly into a text file (or list view) without taking too much memory. Thanks for your reply some piece of code would be appreciated.