problem of readdir on IA64 suse

 
Thread Tools Search this Thread
Operating Systems Linux SuSE problem of readdir on IA64 suse
# 1  
Old 08-24-2009
problem of readdir on IA64 suse

Dear Experts,

i am trying to find whether the given name is file or a directory

Code:
dirp = opendir(dirname);
direntp = readdir(dirp);
if(direntp->d_type & DT_DIR)
 {
   printf("\n is a dirctory");
 }
else
  {
    //dir_or_file = Mtrue;
   printf("\n not a directory");
  }

it always gives me not a directory but the same code works with red hat 64 bit but not working with suse ia 64 m/c please can you give the reason.

thanks in advance.
# 2  
Old 08-24-2009
are the versions of the libraries you are calling identical on both? Have you looked at both libraries and header files you are using? I am assuming this is C code, as if you were using a shell you could use the built in test function to test for directories or not.

Have you checked any intel documentation?
# 3  
Old 08-25-2009
Dear experts,
thank you for the reply,

no both of them are not the same version.
can you please what is the reason why this is failing in ia64 ,
version i have got 2.6.16,whether it is version dependent or any calls have been replaced,

apart from comparison with Red Hat linux i just wanted to know is it a common issue or specific.

Code:
direntp->d_type & DT_DIR

# 4  
Old 08-25-2009
Wait.....regardless of them being 64bit, is the Red Hat machine ia64 (Itanium) or is it x86-64 or some other architecture? If it is not, ia64 is a totally different instruction set with different compilers and libraries and function calls.
# 5  
Old 08-26-2009
Thank you for the reply,

the Red Hat machine is x86-64 not IA64 , so according to you this ia64 architecture is the problem for this, is it so.
# 6  
Old 08-26-2009
That is very possible. Just because they are both 64bit does not mean they both behave the same way.

ia64 is a totally different instruction set with different compile and runtime options. I would look over the documentation as I am not adept at coding enough to make any sort of recommendation here, but it would be a somewhat safe choice to think that different architectures might behave differently with different levels of libraries.

---------- Post updated at 02:45 PM ---------- Previous update was at 08:43 AM ----------

I just spoke to another admin here who is a C coder. His suggestion is remove this:

->d_type & DT_DIR

and make your code look like this:

dirp = opendir(dirname);
direntp = readdir(dirp);
if(direntp)
{
printf("\n is a dirctory");
}
else
{
//dir_or_file = Mtrue;
printf("\n not a directory");
}

And it should work on both
# 7  
Old 08-27-2009
Thanks you for the reply,

i have already replaced my code with
Code:
dirp = opendir(dirname);
direntp = readdir(dirp);

which is even working but wanted to know what exactly the resaon of failure on IA64 thats all as you are saying as may be the instruction set difference,

i have to be very carefull with respect to other functions on IA 64 no idea with what it fails.

thanks again.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Emergency UNIX and Linux Support

Gbrowse and GD installation in ia64 linux problem facing...

Hi all, I'm trying to install of Gbrowse recently. Unfortunately, I stuck at the step to install GD which are prerequisite for Gbrowse installation. I got try to install it, but it seems like got a lot of error message occurred :( And still can't fix the problem yet. I'm using ia64 linux... (10 Replies)
Discussion started by: patrick87
10 Replies

2. Filesystems, Disks and Memory

RAID Problem on SUSE 11.0

I setup a RAID 5 with 5 drives, one failed, hardware failure so I physically removed it from the raid after powering the machine off then powered it back on and my raid was still good but no 5th drive. I built a 5th drive from scratch and added it in the raid thinking the raid would go into... (0 Replies)
Discussion started by: lacakid
0 Replies

3. Programming

Problem shmat in HP-UX Titanium ia64. EINVAL Error

I have a process that needs two active connections to the same zone of shared memory simultaneously. The firs conection works ok, but when i do the second call to shmat it give me error 22 (EINVAL). Only works ok the second call to shmat if i disconnect the first connection (shmdt) Steps:... (3 Replies)
Discussion started by: dairby
3 Replies

4. Shell Programming and Scripting

grep readdir

Quick question. I can not get the context corrert on this code. opendir(DIR, "."); @fileldiv = grep(/l*/,readdir(DIR)); closedir(DIR); I am trying to search all html files within a dir that start with l. Thanks for your help. (1 Reply)
Discussion started by: mrlayance
1 Replies

5. SuSE

GUI problem with Suse Linux

hi Guys,, Am very new to Linux OS.. This is my first experience with Linux. I have installed linux suse 10 in my laptop.it was working fine.. suddenly after 3 days,(i was changing some options of the already installed linux) when i login, i am getting only command interface and GUI is not... (2 Replies)
Discussion started by: mac4rfree
2 Replies

6. Programming

Finding wildcards in readdir

I am having a hard time doing this and can't seem to find an example to help me. This is my code: DIR *dirp=opendir(pathname); struct stat filebuf; struct dirent entry; struct dirent *dp=&entry; RWCString pattern; for (int i = 0; i < request_->getNumStreams(); i++) { ... (2 Replies)
Discussion started by: ajgwin
2 Replies

7. UNIX for Dummies Questions & Answers

how to man readdir(3)

I read the description of the command readdir by using 'man readdir'. However, in the description i was suggesed to refer to readdir(3). I wonder how to see the manual of readdir(3) Thanks (1 Reply)
Discussion started by: cy163
1 Replies

8. SuSE

SuSE parted problem

Hello, So, I burned the 5 cds of SuSE 10.1, and would really like to begin installation. But when I get to the partitioning phase, I get an error message saying the first hard drive is unreadable by parted, and that I'll have to use Yast instead. It also tells me I wont be able to move delete... (0 Replies)
Discussion started by: Mudrack
0 Replies

9. UNIX for Dummies Questions & Answers

suse 9.0 problem video

i got a NV11 geForce2 100/200 and suse 9.0 pro boot the kernal but then the screen goes blank and nothing else can't install suse 9.0 pro and grabs for this problem x will not come up at all just the boot screen with rez and so on but once i tell it to install thats i have a nec multisync... (6 Replies)
Discussion started by: 3bumbs plumming
6 Replies

10. UNIX for Dummies Questions & Answers

SuSE 8.1 NIC problem

i have just installed suse 8.1 on a third computer which has an Asus p4s8x with onboard NIC and sound. now, on install suse detected everything automatically with no probelm, however upon reboot the sound failed to load as well as the network card. /dev/eth* doesnt exist. i looked in the bios and... (2 Replies)
Discussion started by: norsk hedensk
2 Replies
Login or Register to Ask a Question

Featured Tech Videos