doomDVD
20th September 2003, 01:24
hi all i have been trying to figure out how to get the LBA of a specified file using ioctl functions, not aspi/udf(aspi). i came accross some source-code in an open source linux dvd program. but i have no idea how to reacreate the function in WINDOWS can any of you guys please help me.
here is the linux code i found:
---------------------------------------------
#ifndef FIBMAP
#define FIBMAP 1
#endif
int PathToLBA(char *filename)
{
int fd = open(argv[1], O_RDONLY);
if(fd < 0)
{
printf("unable to open file: %s\n", strerror(errno));
return(-1);
}
int lba = 0;
if(ioctl(fd, FIBMAP, &lba) < 0)
{
printf("ioctl failed: %s\n", strerror(errno));
return(-1);
}
return(0);
}
---------------------------------------------
if anyone has a windows version of this it would be a major help
thanx in advance, and thanx for all your previous help.
kind regards
doomDVD
here is the linux code i found:
---------------------------------------------
#ifndef FIBMAP
#define FIBMAP 1
#endif
int PathToLBA(char *filename)
{
int fd = open(argv[1], O_RDONLY);
if(fd < 0)
{
printf("unable to open file: %s\n", strerror(errno));
return(-1);
}
int lba = 0;
if(ioctl(fd, FIBMAP, &lba) < 0)
{
printf("ioctl failed: %s\n", strerror(errno));
return(-1);
}
return(0);
}
---------------------------------------------
if anyone has a windows version of this it would be a major help
thanx in advance, and thanx for all your previous help.
kind regards
doomDVD