Thread: win 9x!!!....win xp ??

  1. #1
    and the Hat of Clumsiness GanglyLamb's Avatar
    Join Date
    Oct 2002
    Location
    between photons and phonons
    Posts
    1,110

    Exclamation win 9x!!!....win xp ??

    k long time ago i made a dos app in C.
    it was on a win9x OS and the program checked if there was a command in the system.ini file, if not he would make one else it would skip the adjustment of the .ini file.

    By doing this u only had to run this prog once and the rest of the time it would startup when u started windowse 9x.

    Now the program opened a file using fopen("blabla.txt","a+");
    at the end i didnt fclosed it. And in the program was a while loop (infinite one)
    while(1){
    this would make sure that data was constantly being written away to text files..... Now you would aspect an abortion of data transmission and writing when the app is manually closed.... (somekind of an emergency flcose by the OS).
    But now what happened the app was closed and it was still writing data to the text file(if you pressed alt-ctrl-delete then it wasnt to see anywhere so it was really really closed of). At a certain moment i noticed that the comp was going awfully slow (that was after 30 after i had closed the app). I went looking to the txt file were data was written to by the prog. And after those 30 sec approx it was already 350 MB big.

    This was done in win9x (os didnt gave any warning)
    I also did this in xp (without using system.ini) and it gave me an error that there was not enough virtual memory....

    Xp did gave a warning BUT none of the tested OS's automatically closed the txt file (that was increasing enormesly with the second)
    Isnt this some sort of a leak in stabilty of the system ??

  2. #2
    and the Hat of Clumsiness GanglyLamb's Avatar
    Join Date
    Oct 2002
    Location
    between photons and phonons
    Posts
    1,110
    if you peeps want i want to include the source code so you can all seek it out urself ......
    ive made a quick calculation
    by opening this program once: u get 250Mb*2*60=30000
    so within an hour that comp will have 30 GB less.... not to mention virtual memory (because of no Harddisk space available)...

  3. #3
    Registered User
    Join Date
    Sep 2002
    Posts
    1,640
    What's the use exactly?
    I don't think XP likes it when a pogram is constantly running,
    even started before its boot, Maybe it doesnt like the program
    eating memory? WinXP has its own will you know?

  4. #4
    and the Hat of Clumsiness GanglyLamb's Avatar
    Join Date
    Oct 2002
    Location
    between photons and phonons
    Posts
    1,110
    there isnt a use of it im just saying that this app that is only 30 kb big can mess up ur comp.
    it just amazed me that all those fancy OS dont have any built-in security against this.
    i bet if you saw what it did to a comp u would think the same as me.

  5. #5
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    The OS can't tell whether the file being written is garbage or not. In your case, it would be garbage, but if you unzip a 800Mb winzip file, it wouldn't...
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  6. #6
    and the Hat of Clumsiness GanglyLamb's Avatar
    Join Date
    Oct 2002
    Location
    between photons and phonons
    Posts
    1,110
    i know it can tell that but if you press the x button in a console app wouldnt the OS close any files being opened by that console??(that is if u forgot to write fclose(file) at the end of the program)

    i mean this thing can make a comp go crazy and none of the existent OS have something against it. Somekind of a program that is called whenever another program is closed to make sure that all files who were needed to run that ,alrdy closed off, app being closed.

    i just feel that this is a major defect in evry OS (not that i would write them better because i cant but i stumbled on this one a month ago and kept on thinking about it)

    i dont know if you have ever tried something like this...
    be my guest
    Code:
    #include <stdio.h>
    #include <stdlib.h>
    
    int main()
    {
    	FILE *garbage;
    	garbage=fopen("garbage.txt","a+");
    	if(garbage==0){
    						printf("Error\n");
    						exit(-1);
    						}
    	while(1){
    				fprintf(garbage,"000000000000000000000000000000000000000000000000000");
    				}
    	return 0;
    	}
    notice i didnt used an fclose(garbage);
    ::note::
    if u run this be sure to keep on checking how big the file garbage.txt is becoming....

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 8
    Last Post: 05-07-2009, 11:31 AM
  2. help with this
    By tyrantil in forum C Programming
    Replies: 18
    Last Post: 01-30-2005, 04:53 PM
  3. Question..
    By pode in forum Windows Programming
    Replies: 12
    Last Post: 12-19-2004, 07:05 PM
  4. Dual Booting Win XP & Win 98
    By netboy in forum Tech Board
    Replies: 2
    Last Post: 08-18-2003, 02:29 AM
  5. Win XP dial-up setup
    By C-Dumbie in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 11-15-2002, 01:10 PM