The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Operating Systems > Linux > SuSE
.
google unix.com



SuSE SUSE Linux is a major operating system. The developer rights are owned by Novell, Inc.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Problem shmat in HP-UX Titanium ia64. EINVAL Error dairby High Level Programming 3 08-04-2009 10:22 AM
GUI problem with Suse Linux mac4rfree SuSE 2 11-12-2008 02:20 AM
HP-UX 11.23 ia64 and Glance LisaS UNIX for Dummies Questions & Answers 2 01-03-2008 01:38 PM
SuSE parted problem Mudrack SuSE 0 06-12-2006 11:10 AM
SuSE 8.1 NIC problem norsk hedensk UNIX for Dummies Questions & Answers 2 04-07-2003 10:54 AM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-24-2009
vin_pll vin_pll is offline
Registered User
  
 

Join Date: Sep 2007
Posts: 29
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 (permalink)  
Old 08-24-2009
mark54g mark54g is offline
Registered User
  
 

Join Date: May 2008
Posts: 363
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 (permalink)  
Old 08-25-2009
vin_pll vin_pll is offline
Registered User
  
 

Join Date: Sep 2007
Posts: 29
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 (permalink)  
Old 08-25-2009
mark54g mark54g is offline
Registered User
  
 

Join Date: May 2008
Posts: 363
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 (permalink)  
Old 08-26-2009
vin_pll vin_pll is offline
Registered User
  
 

Join Date: Sep 2007
Posts: 29
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 (permalink)  
Old 08-26-2009
mark54g mark54g is offline
Registered User
  
 

Join Date: May 2008
Posts: 363
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
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:32 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0