Mail Archives: djgpp-workers/2001/07/11/14:08:55
According to Eli Zaretskii:
> > From: "Andrew Cottrell" <acottrel AT ihug DOT com DOT au>
> > The src/libc/dos/io/_*.c files seem to be inconsistent as some check the
> > _osmajor version number if LFN is used and some don't.
>
> Hmm... that's true. Martin, do you remember why _open and _creatnew,
> for example, use a different logic as far as OS versions are
> concerned?
I think the thinking was LFNs supported -> FAT32 supported. Thus the code.
> > Do you have any sample apps for me to try?
>
> Martin, perhaps you could send your test program to Andrew?
I'm having problems finding them, but here's one:
#include <unistd.h>
#include <stdio.h>
#include <limits.h>
#include <fcntl.h>
#include <sys/stat.h>
int main(int argc, char *argv[])
{
char ch = 'G';
int fd;
long long new_size;
long long ret;
if( argc != 2
|| sscanf(argv[1], "%lld", &new_size) != 1
)
{
fprintf(stderr, "%s: run like this '%s <size_to_write>'.\n",
argv[0], argv[0]
);
exit(1);
}
printf("Seeking to %lld.\n", new_size);
fd = open("f:/ggg.hmm", O_RDWR|O_CREAT, S_IWUSR);
if( 0 <= fd )
{
printf("fd = %d.\n", fd);
llseek(fd, new_size, SEEK_SET);
ret = write(fd, &ch, 1);
printf("1: ret = %lld.\n", ret);
close(fd);
}
else
{
perror("Ouch");
}
return(0);
}
Right,
MartinS
- Raw text -