Sunday, April 3, 2011

One wrong click and all my files gone!

   Currently I am working on an application for syncing folders(yeah I know its a common app,but it's a useful one!).I as usual started could not compile the code in the first time coz of some syntax errors but what followed next was more horrific(for me) and enjoyable(for some).
   In my code I instead of copying the file, wrote the command for moving the file.Now, for the command we need to give a name for the output file. As this is a sync app, I need to give the same name to the output file.Hence, there came a villain named extractname(). It extracted the name Ok but it gave the name in the reverse order! Hence beads.c became c.sdaeb! Also, I forgot to add another '\' at the end of the folder name.
  But, this was a logical error and not a syntax error so it passed without any trouble till I ran it. While running it, I thought that there would not be a major problem and hence selected a not so important folder as the source and a new folder as destination.
  But, fate had something else in mind! Not only did all my files move out of the folder but as I had forgotten to put the extra '\' in place, they all went to the wrong folder and it's not over yet. The files were named like testc.sdaebs and testc.xiptas .I was stunned, confuse and angry over myself. Thankfully, after some debugging I came to know about the horrific mistake I made. Now I have renamed the files and they are at the right places. Also the code is corrected and the basic version of my app is ready.Now some more functionality and the app will be completely ready!

No comments:

Post a Comment