Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Memory allocation for building a DOS Editor

chintu31chintu31 Posts: 2Member
[b][red]This message was edited by chintu31 at 2006-2-4 23:28:44[/red][/b][hr]
I am trying to build a DOS Editor. How can I allocate memory the same way as the normal DOS Editor (Edit) uses.


«1

Comments

  • Gregry2Gregry2 Posts: 607Member
    [b][red]This message was edited by Gregry2 at 2006-2-5 4:4:33[/red][/b][hr]
    : [b][red]This message was edited by chintu31 at 2006-2-4 23:28:44[/red][/b][hr]
    : I am trying to build a DOS Editor. How can I allocate memory the same way as the normal DOS Editor (Edit) uses.
    :
    :
    Erg, such a vaque question, too general.

    two types of allocation
    char* a = new char[60];//allocates a 60 bytes
    string* b = new string;//allocates a string object...I think
    //I dont program in C++

    //in C++, use the keyword ``delete''

    delete b;//for single objects

    //append `[]' to delete to delete the array
    delete[] a;

    [/code]

    thats just basic stuff, its the only thing I can post and know its right :)
    {2}rIng


  • stoberstober Posts: 9,765Member ✭✭✭
    : I am trying to build a DOS Editor. How can I allocate memory the same way as the normal DOS Editor (Edit) uses.
    :
    :
    :

    editors that can edit huge files do not load the file into memory all at one time.

  • IDKIDK Posts: 1,784Member
    : : I am trying to build a DOS Editor. How can I allocate memory the same way as the normal DOS Editor (Edit) uses.
    : :
    : :
    : :
    :
    : editors that can edit huge files do not load the file into memory all at one time.
    :
    :

    Notepad loads the whole file into memmory.
    Wordpad doesn't.
  • stoberstober Posts: 9,765Member ✭✭✭
    :
    : Notepad loads the whole file into memmory.
    : Wordpad doesn't.
    :


    Notepad limits the size of the file, Wordpad doesn't.
  • Gregry2Gregry2 Posts: 607Member
    :
    : Notepad limits the size of the file, Wordpad doesn't.
    :

    So what, when you reach a certain point logically in a file which is the end of that which is loaded, it loads the rest?
    {2}rIng
  • IDKIDK Posts: 1,784Member
    : :
    : : Notepad limits the size of the file, Wordpad doesn't.
    : :
    :
    : So what, when you reach a certain point logically in a file which is the end of that which is loaded, it loads the rest?
    : {2}rIng
    :

    And deallocates the what's isn't needed.
    Simple buffering technices. But it is still easier to just load the whole file.
  • stoberstober Posts: 9,765Member ✭✭✭
    [b][red]This message was edited by stober at 2006-2-5 7:40:16[/red][/b][hr]
    : : :
    : : : Notepad limits the size of the file, Wordpad doesn't.
    : : :
    : :
    : : So what, when you reach a certain point logically in a file which is the end of that which is loaded, it loads the rest?
    : : {2}rIng
    : :
    :
    : And deallocates the what's isn't needed.
    : Simple buffering technices. But it is still easier to just load the whole file.
    :

    yes, its certainly easier, but what happens if the file size is several gigs or terabytes? It won't all fit in memory at once, so you have to work with small chunks. I suspect Wordpad uses memory mapped files and let the os do all the difficult work of synchonizing the file with what is in memory.



    But -- neither Notepad nor Wordpad are MS-DOS editors, as indicated in the original post. They are MS-Windows editors. So if you are writing an MS-DOS editor then the program is limited to 640K (minus memory for the operating system and TSRs).
  • IDKIDK Posts: 1,784Member
    : [b][red]This message was edited by stober at 2006-2-5 7:40:16[/red][/b][hr]
    : : : :
    : : : : Notepad limits the size of the file, Wordpad doesn't.
    : : : :
    : : :
    : : : So what, when you reach a certain point logically in a file which is the end of that which is loaded, it loads the rest?
    : : : {2}rIng
    : : :
    : :
    : : And deallocates the what's isn't needed.
    : : Simple buffering technices. But it is still easier to just load the whole file.
    : :
    :
    : yes, its certainly easier, but what happens if the file size is several gigs or terabytes? It won't all fit in memory at once, so you have to work with small chunks. I suspect Wordpad uses memory mapped files and let the os do all the difficult work of synchonizing the file with what is in memory.
    :
    :
    :
    : But -- neither Notepad nor Wordpad are MS-DOS editors, as indicated in the original post. They are MS-Windows editors. So if you are writing an MS-DOS editor then the program is limited to 640K (minus memory for the operating system and TSRs).
    :

    If you open a file bigger than 65K in notepad it says it can't open the file and suggest to open it in wordpad.

    It isn't much harder making a msdos editor than a windows one.
  • Gregry2Gregry2 Posts: 607Member
    [b][red]This message was edited by Gregry2 at 2006-2-6 1:26:1[/red][/b][hr]
    : : [b][red]This message was edited by stober at 2006-2-5 7:40:16[/red][/b][hr]
    : : : : :
    : : : : : Notepad limits the size of the file, Wordpad doesn't.
    : : : : :
    : : : :
    : : : : So what, when you reach a certain point logically in a file which is the end of that which is loaded, it loads the rest?
    : : : : {2}rIng
    : : : :
    : : :
    : : : And deallocates the what's isn't needed.
    : : : Simple buffering technices. But it is still easier to just load the whole file.
    : : :
    : :
    : : yes, its certainly easier, but what happens if the file size is several gigs or terabytes? It won't all fit in memory at once, so you have to work with small chunks. I suspect Wordpad uses memory mapped files and let the os do all the difficult work of synchonizing the file with what is in memory.
    : :
    : :
    : :
    : : But -- neither Notepad nor Wordpad are MS-DOS editors, as indicated in the original post. They are MS-Windows editors. So if you are writing an MS-DOS editor then the program is limited to 640K (minus memory for the operating system and TSRs).
    : :
    :
    : If you open a file bigger than 65K in notepad it says it can't open the file and suggest to open it in wordpad.
    :
    : It isn't much harder making a msdos editor than a windows one.
    :
    [green]
    So, say the user gets to a certain point in the file beyond 64K in an MSDOS editor. Is this actually simply when the cursor passes a certain point? Then the memory in use is exchanged for the next 64K bytes of the file after the last, correct? Wouldn't that cause like a delay in the program and confuse the user?

    I haven't made an editor before, but I want to make a program like a text file preprocessor, so please explain on this.

    thanx
    {2}rIng[/green]


  • chintu31chintu31 Posts: 2Member
    Hi! Thanks for your valuable input.

    But, here we are talking about the MS-DOS editor (Edit command in DOS). I have designed the program already but getting stuck in this area only. I am trying to find out how can I allocate memory so that I can create a file, read, write in the same fashion as the normal DOS editor do.

    Please Help.....
«1
Sign In or Register to comment.