fopen vs open
i did have a search for this.
i understand open is a low-level version of fopen and allows greater control over devices. file permissions can also be set on the same line.
what are the pros of using fopen over open? i need to be able to set permissions. what is the best way of doing this with fopen?
some stuff on the web discussed the problems of using many fopens at once. also that using open may cause performance problems.
>>i need to be able to set permissions. what is the best way of doing this with fopen?
You can't, I don't believe.
Is this *nix specific, if so, I'll move it to the other board.
yeah, i'm using open at the moment. i just wasn't sure of the practical differences.
i think this is relevent to both. maybe more useful in the linux prog board.
ok, thanks for the correction.
i wasn't aware that open was posix specific. my question has been answered.
fopen() doesn't deal with permissions, you need to use the chmod() system call for that if you're under Linux.
for those who may be interested and not know, open() also allows lower-level file control under ms-dawz, but i'd imagine in different ways than a posix version.