Announcement

Collapse
No announcement yet.

DOS Programs Safe For NTFS File System?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • DOS Programs Safe For NTFS File System?

    I switched from Win98SE to WinXP Pro a couple of days ago. After reformatting
    my HDD with the XP install CD, and installing XP, I then installed
    my autoinstalling backup CD of my PB stuff. I then installed my
    Roxio Platinum 5 burning software, then immediately backed up my PB
    DOS subfolders (PB/DOS 3.5 and MASM 6.14), then deleted those folders.
    I did this stuff because some people have informed me that DOS
    proggies are not 'safe' for NTFS file system HDD's. Can anybody verify
    for me whether this is or is not true? I trust the advice that
    I get from the people in these forums much more than I do "word-of-mouth"
    from (usually) much less experienced people. If what I was told is not
    true, then I shall immediately dump my DOS folders backup back to my
    PB parent folder.

    One other question, related: if a PB/DOS 3.5 program I write
    OPENs a file, PRINTs to it, then CLOSEs it, would THAT be safe for
    NTFS file systems?

    Thank you very much for any replies/advice.


    ------------------


    [This message has been edited by Clay Clear (edited June 27, 2004).]

  • #2
    I work often with PB/DOS 3.50 (and also the old old Basic 7.1 PDB) on NTFS partitions, under WinXP, and I haven't noticed problems that could be related to the file system.
    The same (with BC7) when I was working under OS/2 on HPFS, or NT with the older NTFS.

    Bye!

    ------------------
    Try TrID file identifier! 1.100 filetypes and counting...
    Give a powerfull scriptable Lua interface to your application with PowerBLua
    PBTracer - Tracer / Profiler for PowerBASIC (soon!)

    [This message has been edited by Marco Pontello (edited June 27, 2004).]
    -- The universe tends toward maximum irony. Don't push it.

    File Extension Seeker - Metasearch engine for file extensions / file types
    Online TrID file identifier | TrIDLib - Identify thousands of file formats

    Comment


    • #3
      Thanks, Marco.


      ------------------

      Comment


      • #4
        They told you what?

        Your DOS programs will be just fine, unless they attempt to employ
        extremely low-level disk access. A program intended to defragment a
        FAT drive isn't going to do anything healthy to an NTFS drive. But,
        I don't know that XP would even permit such an attempt, anyway.

        ------------------
        Tom Hanlin
        PowerBASIC Staff

        Comment


        • #5
          Thanks, Marco and Tom. I have dumped my DOS folders from their
          backup CD back to the PB parent folder on the C: drive.

          Thanks, again.


          ------------------

          Comment


          • #6
            Hi, maybe this is not directly related but ...

            I use WinXp where i have a NTFS file system. I have problems maintaining
            my database while the program is in use since long time...

            What Problems?
            I have a big "random" database (filelenght is over 2.150.000.000 bytes).
            I use a file manager written by me in PB3.50 for dos. I calculate the
            database-end-record by the normal "recnum???=lof(x)/reclenght"...

            Once my file is over 2.150.000.000 bytes long, lof(buf) returns a wrong
            number of bytes where it should return the exact filelenght...

            Is that error related to the fact that PB cannot handle files over a given
            limit, is it related to the fact that lof(x) has a limit or is there somewhere
            a bug that i dont know about ???

            Using "datatype ???" it should be posible to access 4,294,967,295 records,
            meaning that at max my file would be "4,294,967,295 * 80 bytes" ...

            Any-One has an Idea ??


            ------------------
            Never code today what you did not code yesterday ...

            [This message has been edited by andre drabs (edited July 03, 2004).]
            NEVER code TODAY what you DID NOT code YESTERDAY ...

            Comment


            • #7
              >is it related to the fact that lof(x) has

              Limit is long integer value: 2,147,000,000 and some change.

              (Which I also think is some kind of MS-DOS limitation?)

              Of course if LOF() is returning the full 32-bits, and when assigned to a LONG is less than zero, you can convert to DWORD with the BITS??? function.


              Michael Mattias
              Tal Systems Inc. (retired)
              Racine WI USA
              [email protected]
              http://www.talsystems.com

              Comment


              • #8
                Hi Michael,

                If lof() has indeed that limit it is a problem for large databases
                since that would mean that the "get" and "put" instructions will
                probably have the same limitations... that probable "get" and "put"
                limitation is only a factor of the full recordlenght further...

                It would also mean that creating databases with more than 2,147,483,647
                records would not be possible ... a world-registery f.ex...

                I cannot see directly any way around this problem but will do some
                further testings... I will post results of my findings here...

                I cannot see what Ms-Dos should have to do with it because i use XP
                on a NTFS partition while running PB in an XP-window...

                Thanks anyway for your reply

                ------------------
                NEVER code TODAY what you DID NOT code YESTERDAY ...
                NEVER code TODAY what you DID NOT code YESTERDAY ...

                Comment


                • #9
                  Michael,

                  I came up with a quick and dirty replacement for EOF(x), this one
                  will give the correct filelenght till 4,294,967,295... I retrieved
                  the getdta(x,x) and dtasize() in the dirunit.bas file and re-used
                  that to gather the filelenght.

                  The get and put instructions are apparantly not limited to
                  2,147,483,647 records, they will do the job till 4,294,967,295
                  records... Only that is also the limit of the MyLOF??? so that
                  the number of records in my database will be limited to
                  4,294,967,295 / reclenght...

                  SomeOne has a way around that? Any idea is welcome...

                  This is the Q&D coding ...
                  CLS
                  OPEN"r",1,"mytest.txt",80
                  Field 1,80 AS tmp$
                  fr1???=MyLOF???("mytest.txt")
                  PRINT fr1???
                  CLOSE
                  END

                  FUNCTION MyLOF???(A$) Public
                  Tmp$=DIR$(A$)
                  MyLOF???=DtaSize()
                  END FUNCTION


                  Coding found in DirUnit.bas in PB example dir
                  SUB GetDTA(DtaSeg AS INTEGER, DtaOfs AS INTEGER) PUBLIC
                  ! push DS ; save DS for PowerBASIC
                  ! mov AX, &H2F00 ; function 2Fh, get DTA location
                  ! int &H21 ; call DOS
                  ! lds SI, DtaSeg ; point DS:SI at DtaSeg
                  ! mov DS:[SI], ES ; put segment of DTA in variable
                  ! lds SI, DtaOfs ; point DS:SI at DtaOfs
                  ! mov DS:[SI], BX ; put offset of DTA in variable
                  ! pop DS ; restore DS for PowerBASIC
                  END SUB

                  FUNCTION DtaSize() PUBLIC AS LONG
                  DIM DtaSeg AS INTEGER,_
                  DtaOFs AS INTEGER
                  GetDTA DtaSeg, DtaOfs ' Get DTA address. (See SUB GetDTA
                  ' in this unit.)
                  DEF SEG = DtaSeg ' Set segment to DTA address segment
                  FUNCTION = PEEKL(DtaOfs+26) ' Use PB's PEEKL to retrieve four-byte
                  ' file size and convert to long integer.
                  DEF SEG ' Return segment to previous value.
                  END FUNCTION

                  ------------------
                  NEVER code TODAY what you DID NOT code YESTERDAY ...

                  [This message has been edited by andre drabs (edited July 04, 2004).]
                  NEVER code TODAY what you DID NOT code YESTERDAY ...

                  Comment


                  • #10
                    >It would also mean that creating databases with more than 2,147,483,647
                    >records would not be possible ... a world-registery f.ex...
                    >I cannot see directly any way around this problem

                    Um, how about selecting a different operating system (Windows comes to mind, considering you are already using it) and using a Windows development tool? (I believe PowerBASIC Inc has several suitable offerings). Or, if your heart is set on an MS-DOS application, there may be a third-party data manager capable of handling files this large?

                    Or, store the data in multiple files, each of a size you can handle.

                    Lots of ways to solve your challenge. Just takes a little imagination.


                    Michael Mattias
                    Tal Systems Inc. (retired)
                    Racine WI USA
                    [email protected]
                    http://www.talsystems.com

                    Comment


                    • #11
                      Michael,

                      You suggest that i would have to:
                      1)<<using a Windows development tool? (I believe PowerBASIC Inc has
                      <<several suitable offerings).
                      2)<<Or, if your heart is set on an MS-DOS application, there may be
                      <<a third-party data manager capable of handling files this large?

                      I did learn programming "back in time (1985)" with Turbo Basic. Since
                      then i had every new version of Powerbasic (2.0B, 2.10, 3.0a, 3.20, 3.50)
                      Every time i had to learn new additions, functions and more. At the time
                      i started there was little or no help, code-exchange nor idea-exchange here
                      in Belgium. All of my programs are written for hobby and personal use, not
                      commercial. I am 47 now and feel 18 but i dont plan to continue learning
                      new languages or styles. Moving to PB for windows is not an option since
                      that is a direction who will force me at term to continue spending time and
                      money in learning. I just try to squeese out the max of a language that i
                      think to know a little, or better, where i feel myself good with.


                      3)<<Or, store the data in multiple files, each of a size you can handle.
                      Multiple files are not an option since how do you sort your database then?
                      Shunk by shunk? No, i bet there is a simple way around the problem of using
                      longs or quads to save records on a diskfile, just like there was a simple
                      way around the filesize instruction LOF(x). Maybe it has to be written in
                      inline assembler but there i am lost... Getting a little help from "the
                      specialists" would been appreciated, especially by those who can just have
                      some fun programming and discover (many years too late) how simple some
                      "for us - amazing -" things can be done...

                      Speaking of sorting, there is the same problem again. In memory ? I stopped
                      longtime ago memory-sorts... I modified the quicksort routine to do direct
                      disk sort... I just moved the limits a bit further, now i am limited by the
                      "quad-limit" of get & put instruction... Till i or someone resolves that...
                      ------------------
                      NEVER code TODAY what you DID NOT code YESTERDAY ...

                      [This message has been edited by andre drabs (edited July 04, 2004).]
                      NEVER code TODAY what you DID NOT code YESTERDAY ...

                      Comment


                      • #12
                        The horse - with or without the carriage - was the best form of transportation for both goods and people - for several hundred years.

                        But that ended.

                        Michael Mattias
                        Tal Systems Inc. (retired)
                        Racine WI USA
                        [email protected]
                        http://www.talsystems.com

                        Comment


                        • #13
                          Just some horses wins races while others loose them...
                          Not shure Windows is the leading horse...

                          ------------------
                          NEVER code TODAY what you DID NOT code YESTERDAY ...
                          NEVER code TODAY what you DID NOT code YESTERDAY ...

                          Comment


                          • #14
                            DOS was not designed to deal with files larger than about 2 GB. You
                            might, maybe, find a way to work around that a little, under XP,
                            since the "DOS" is a Windows program. That seems like an extremely
                            dangerous game to play, though.

                            If you need to work with larger files, think PB/CC or PB/Win.

                            ------------------
                            Tom Hanlin
                            PowerBASIC Staff

                            Comment


                            • #15
                              Hey andre, I'm older than you, and I managed to convert to PBCC from
                              M$ PDS7.1 with very little trouble.

                              Now, I just revel in all that memory and those lovely big DWORDS!

                              Still use the PDS for prototyping a bit though, the debugger is just brilliant.

                              Go for it!

                              ------------------

                              Comment

                              Working...
                              X