• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 251
  • Last Modified:

Problem reading/writing sectors

I made a program in Turbo Pascal 7.0 that sometimes reads sectors (using REGS and INTR standard procedures) from a floppy disk and writes it back to the same sector when my program do some modifications to the information, But sometimes in Windows 95 (DOS box) when I do this operation many times, the program "read" the sector but not writes its contents back (no writes anything). When I try this program in Windows NT (MS-DOS Console), it reads the sector but not writes back anything(!). What happen in this two cases? I need DPMI or something? The program works without problems in Win95 DOS Only-Mode and DOS 6.x. Thanks a Lot!!!
0
mapadu2000
Asked:
mapadu2000
1 Solution
 
omsecCommented:
Windows 95 and Windows NT 4.0 use different FATs. I think there is the problem.
0
 
mapadu2000Author Commented:
What programming tool (language) I need for re-write the application as Win32 Console App? Thanks a Lot
0
 
omsecCommented:
it depends, if u still want a program designed for DOS or (Dos-Mode) i think it can be done with BP7 (protected mode) or if you wish a 32-bit win-exe you could use Delphi, this is pascal based
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
mapadu2000Author Commented:
In Delphi, How I can read/writes sectors? Can you give me an example code? Thanks
0
 
extremeCommented:
I suggest you to compile your program in BP7 protected mode and try if it works in that mode.
0
 
omsecCommented:
you can't do direct disk reads in windows.

from win32sdk.hlp:

Windows NT: You can use the CreateFile function to open a disk drive or a partition on a disk drive. The function returns a handle to the disk device; that handle can be used with the DeviceIOControl function.
0
 
jlove1Commented:
before running the program under windows 95.. Try using the LOCK command
lock a:

This will allow the program to have "DIRECT" access to the sectors on the drive by bypassing dos.

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now