Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!uunet!europa.asd.contel.com!sura.net!haven!mimsy!mojo!mojo!djm From: djm@eng.umd.edu (David J. MacKenzie) Newsgroups: comp.lang.perl Subject: Re: directory entries chopped on SCO Unix Message-ID: Date: 5 Mar 91 10:45:14 GMT References: <18097@ogicse.ogi.edu> Sender: news@eng.umd.edu (C-News) Organization: Project GLUE, University of Maryland Lines: 28 In-Reply-To: schaefer@ogicse.ogi.edu's message of 3 Mar 91 05:49:53 GMT In article <18097@ogicse.ogi.edu> schaefer@ogicse.ogi.edu (Barton E. Schaefer) writes: } I just built pl44 on SCO Unix 3.2.2 and find that the filenames } returned by Perl's readdir function are missing the first two } characters. It works fine on SunOS. Anyone have a fix for this } problem? } -- } David J. MacKenzie Yeah, make sure you DO NOT use -lx when linking. It has (incorrect, ore more accurately, outdated) opendir(), readdir(), closedir() etc. calls, which get used in place of the (correct) ones in libc. Yep, that fixed it. Configure automatically detects that -lx exists and includes it in the suggested list of libraries to link with, but all I had to do was explicitly type in the rest of them at the prompt instead of accepting the default. Configure also seems to have detected that fcntl exists and used that instead of chsize. Apparently what happens if you use -lx is perl mismatches the dirent.h header file with the -lx directory routines, which return a different-sized struct. If you use either sys/ndir.h with -lx, or dirent.h with the libc routines, it should work. However, I have heard somewhere that the -lx directory routines don't work under NFS (because they don't use the getdents syscall), which we plan to start using sometime, so I don't want to use them. -- David J. MacKenzie