Stories
Slash Boxes
Comments

SoylentNews is people

SoylentNews is powered by your submissions, so send in your scoop. Only 8 submissions in the queue.
posted by Fnord666 on Friday March 24 2017, @06:49PM   Printer-friendly
from the didn't-need-those-folders-anyway dept.

in with a story on Robert Elder Software blog entitled Silently Corrupting an Eclipse Workspace: The Ultimate Prank:

Next time your co-worker asks:

"What's the best way to back up my Eclipse workspace on Windows?"

you can tell them "Just right-click on it and select 'Send to Compressed (zipped) folder' and save the zip file". Unbeknownst to them, you just pulled the ultimate prank by telling them to make a corrupted backup!

          What your friend probably doesn't realize is that the Windows 'Send to Compressed (zipped) folder' utility has a mandatory optional feature to automatically not include certain folders in the archive without telling you. This is a great feature because it demonstrates the excellent sense of humour that the authors of Microsoft Windows have. This feature was no doubt included to allow you to play a variety of hilarious pranks on others by causing them lose data, only to find out about it years later when they want to open the archive and recover it.

The blog post goes on to identify other idiosyncrasies with how Windows mishandles directories whose names start with a period and/or contain Unicode characters.

Reasons you haven't switched to Linux (cont.):

  • 3. Windows has superior development tools.

What other issues have you found with how Windows handles filenames?


Original Submission

 
This discussion has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • (Score: 2) by number6 on Monday March 27 2017, @05:55PM

    by number6 (1831) on Monday March 27 2017, @05:55PM (#484743) Journal
    The code above at Post #484023 does not compile; it has bad errors. I showed it to a friend who knows C Programming and he fixed it for me.

    Below are three variations of this program; all have been tested and compile to an executable..............:

    Fixed version of the code at Post #484023 :

    /*
     * 'keepopen' - original version - displays a blank console window; to kill the program handle
     * you either close the console window or terminate the program.
     */

    #include <windows.h>

    int main(int argc, char *argv[]){
      HANDLE h;
      if (argc == 2){
        h = CreateFile(argv[1],(GENERIC_READ | GENERIC_WRITE),FILE_SHARE_READ,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
        Sleep(INFINITE); // never returns
        CloseHandle(h);
      }
    }

    'No Console' version :

    /*
     * 'keepopen' - no console version - program persists in background until you manually terminate it.
     */

    #include <windows.h>

    int main(int argc, char *argv[]){
      FreeConsole(); // see https://msdn.microsoft.com/en-us/library/ms683150%28v=vs.85%29.aspx
      HANDLE h;
      if (argc == 2){
        h = CreateFile(argv[1],(GENERIC_READ | GENERIC_WRITE),FILE_SHARE_READ,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
        Sleep(INFINITE); // never returns
        CloseHandle(h);
      }
    }

    'Console Paused Dialog' version :

    /*
     * 'keepopen' - console paused dialog version - console waits and asks you for input to terminate the process and close.
     */

    #include <windows.h>

    int main(int argc, char *argv[]){
      HANDLE h;
      if (argc == 2){
        h = CreateFile(argv[1],(GENERIC_READ | GENERIC_WRITE),FILE_SHARE_READ,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
        system("echo Press any key to release the file handle and close this console && pause > nul");
        CloseHandle(h);
      }
    }

    Starting Score:    1  point
    Karma-Bonus Modifier   +1  

    Total Score:   2