[boulder.pm] open vs. sysopen

Justin Simoni jsimoni at totalsite.com
Wed Jan 17 18:43:31 CST 2001


I'm going to ask a stupid question, but its been said that there aren't any
stupid questions, just stupid people,

Then again, there's something that says philosophers create proverbs, fools
repeat them, 


saying that, 

what is the difference between the two built in Perl functions, open() and
sysopen() in terms of performance, cross platform usage, etc? To my
knowledge, open() is Perl's own way of opening thingies, and sysopen() is
straight from a C library. I know (think) also that sysopen() allows me to
use default permissions to a file, like this:

sysopen(LIST, "$path/$file_name", O_RDWR|O_CREAT, $file_chmod)or die
"couldn't open $path/$file_name for reading: $!\n";

I think I started sysopen on a project when I thought open() wouldn't work.
I think that the problem lay elsewhere, but I still have sysopen() peppered
in the program. any thoughts on these two functions? My program only runs on
*nix, although I would like to see NT supported with as little effort as
possible from me. 

Any help would be super appreciated,

thanks, 

Justin 







More information about the Boulder-pm mailing list