Hello. Have already posted this on beginners board but just realised it probably belongs here, sorry bout that...
Im doing a module on the dos operating system for my collage.
For the project I have to list the deleted files on a floppy disk.
To do this I have been using the turbo c function absread() to read the root directory on the floppy.
The problem I am having is that the absread function seems start reading two bytes after the start of the sector, so for example if the first entry is named "example.txt" it shows up as "ample.txt" in the programme. This also messes up the time and date stamps etc.
Im compiling with turbo c++ 3.0 in windows 98.
My code is posted below, any help would be greatly appriciated...
char name; /*Directory entry format for dos 6.0*/
long int size;
void read_structure(dirstore *);
void list_names(dirstore );
void list_names(dirstore store)
printf("File names in root dir are:
for (lcv = 0; lcv < 244; lcv++)
if (store[lcv].name != 0x00)
for (i = 0; i < 8; i ++)
printf("Filename = %c
for (i = 0; i < 3; i ++)
printf("Extension = %c
printf("Size = %d
printf("Press any key to continue
key = getch();
/* else printf("Unused directory entry
void read_structure(dirstore *readir)
if (absread(0, 14, 19 &readir) != 0)
printf("Error, cannot read drive a: