🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: fj.lang.c
Article #654

Re: dirent.d_name

#654
From: HASHIMOTO, Tsuyoshi
Date: Fri, 27 Mar 1998 00:00
39 lines
2430 bytes
$B66K\!J$D!K!wIY;NDL$G$9!%(B

In article <NEWTNews.890963246.4368.andou@andou.ncs.ts.fujitsu.co.jp>
Toshiya Andoh <andou@ncs.ts.fujitsu.co.jp> writes:

>$B%G%#%l%/%H%jFb$N%5%V%G%#%l%/%H%jL>$r<hF@$9$k$?$a$N%W%m%0%i%`$r!"(B
>solaris 1.x$B7O$G:n@.$7!"$=$l$r(Bsolaris 2.x$B7O$G$bF0$+$=$&$H$7$^$7$?!#(B
>$B$H$3$m$,!"(Breaddir$B$GF@$i$l$k!"(Bdirent$BFb$N%U%!%$%kL>$N>pJs$,F,(B2byte
>$B:o$i$l$FI=<($5$l$^$7$?!#(B
># $B<B:]$K$O!"%U%!%$%kL>$,(B2byte$B$:$l$F3JG<$5$l$F$$$^$7$?!#(B

>$B$&$^$/$$$+$J$+$C$?4D6-(B:
>solaris 2.5          + SUN SPARC C Compiler
>solaris 2.6          + SUN SPARC C Compiler

$BLdBj$N4D6-$G$O!$B?J,(B LD_LIBRARY_PATH $B$J$I$N@_Dj$N4X78(B ($B3NG'J}K!$O(B ldd) 
$B$G(B Solaris2 FAQ ( http://www.wins.uva.nl/pub/solaris/solaris2/ ) $B$K$b(B
$B$"$k2<5-$NLdBj$,5/$-$?$N$G$7$g$&!%(Bman -s3b readdir $B$H(B man -s3c readir 
$B$N0c$$$rLdBj$N4D6-$G3NG'$7$F2<$5$$!%(B

6.19) Why doesn't readdir work? It chops the first two characters of all
filenames.

You're probably linking with libucb and didn't read question 6.18. (Readdir in
libucb.so wants you to include sys/dir.h, but many SunOS 4.1.x programs
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
included <dirent.h>, consequently, you're mixing native <dirent.h> struct
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
dirent with libucb readdir(). The symptom of this mixup is that the first two
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
characters of each filename are missing. Make sure you use a native compiler
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
$BOC$NFbMF$+$i!$(B
	Newsgroups: fj.lang.c,fj.sys.sun
	Followup-To: fj.sys.sun
$B$H$7$^$7$?!%(B
-- 
$B66K\!!9d(B (HASHIMOTO, Tsuyoshi)
Technical Details
Message-ID: <snmemzoisg9.fsf@neptune.spp.hpc.fujitsu.co.jp>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <NEWTNews.890963246.4368.andou@andou.ncs.ts.fujitsu.co.jp>

Show Full Headers
Complete Article Headers
X-Google-Language: Japanese,JIS
X-Google-Thread: 106434,d2ace75549f088b0
X-Google-Attributes: gid106434,public
X-Google-Thread: fcfb5,b280a9437438975a,start
X-Google-Attributes: gidfcfb5,public
From: tsu@spp.hpc.fujitsu.co.jp (HASHIMOTO, Tsuyoshi)
Subject: Re: dirent.d_name
Date: 1998/03/27
Message-ID: <snmemzoisg9.fsf@neptune.spp.hpc.fujitsu.co.jp>
X-Deja-AN: 338165539
Distribution: world
Sender: tsu@neptune.spp.hpc.fujitsu.co.jp
References: <NEWTNews.890963246.4368.andou@andou.ncs.ts.fujitsu.co.jp>
Followup-To: fj.sys.sun
Organization: Fujitsu Ltd.
Newsgroups: fj.lang.c,fj.sys.sun