473,387 Members | 1,374 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

linux links

4
Could someone please point me in the right direction with regards to link 'files'. I would like to be able to use the linux c IO to find/query them, along with other data files. they seem to be evading the file radar: the readdir function (dirent.h) is not picking them.

email.removed@4.ur.protection.com

On a different matter, my thanks to Derrick Coetzee for his sample 'pseudo code' fopen_mkdir. Dodgy as it may be, it was welcome help in my project. Here is my code for it:
Expand|Select|Wrap|Line Numbers
  1. #define FULLPERMISSIONS 0x41ff
  2.  
  3. FILE *fopen_mkdir( char *name, char *mode )
  4. {
  5.     char *mname = (char*) malloc( sizeof( char ) * MAXPATH );
  6.     DIR *DIRp = 0;
  7.     strcpy( mname, name );
  8.     int len = 0, i;
  9.     while ( mname[ len ] != '\0' ) {
  10.          len++;
  11.     }
  12.     for( i = 0; i < len; i++ ) {
  13.         if (( i > 0 ) && ( mname[ i ] == '/')) {
  14.             mname[ i ] = '\0'; // read path up to a slash
  15.             DIRp = opendir( mname );
  16.             if(( mkdir( mname, FULLPERMISSIONS )) && ( !DIRp )) {
  17.              // mkdir failed, NOT because dir already exists
  18.                 fprintf( stdout, " \n *** error opening %s *** \n", mname );
  19.                 return NULL;
  20.             }
  21.             if( DIRp ) {
  22.                 closedir( DIRp );
  23.             }
  24.             mname[ i ] = '/'; // put it back
  25.         }
  26.     }
  27.     free( mname );
  28.     return( fopen( name, mode));
  29. }
  30.  
Dec 17 '07 #1
2 1399
Motoma
3,237 Expert 2GB
Hi nassim, welcome to The Scripts.
Could you please better describe what you are trying to do? I am tying to figure out your end goal.
Dec 18 '07 #2
nassim
4
Hi nassim, welcome to The Scripts.
Could you please better describe what you are trying to do? I am tying to figure out your end goal.
sorry i didn't put that very well

i was kinda hoping for a reply on that same day.. i'm alright now, well n truly in the right direction, thanks
Dec 19 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Jhuola Hoptire | last post by:
Just installed J2RE 1.4.2 on a Linux server. I am very knew to the POSIX world. I couldn't dig-up much in the docs or via google about the following: 1 - Is there a standard way to make sure...
10
by: R.Marquez | last post by:
I hope I don't bore you with this personal experience. But, I hope the details are helpful for other Python and/or Linux newbies, or for those thinking about becoming such. I have been using...
11
by: Tony Baker | last post by:
In order for my company to go ahead and use .Net and C# (over java), I need to know how to install and run a C# ASP.Net application not only on Windows, but on Linux. I'm a Windows developer,...
8
by: Xela | last post by:
Hi A have a very annoying problem. I have written java strored procedures for DB2 v8.1. Their deployement and usage is fine as long as the server is a Windows one. But under Solaris 8 and Linux...
3
by: gooch | last post by:
This is not really a general c question but here goes anyway. I am trying to add a system call to a kernel (redhat 2.4.18) for a class I am taking and I have done the following. in...
1
by: Will Hurt | last post by:
Hi Ive been using midipy in my blender3d python scripts on windowsXP, now im trying to run them from ubuntu and i cant find the midipy.py module compiled for linux anywhere. Is it possible to...
9
by: 8anos | last post by:
Hello, I am new at the community and newbie at programming :) As you may know rapidshare provides a perl script for linux, to upload files at their servers. You can find the original scripts at...
12
by: Magesh | last post by:
Can anyone suggest me a good book to learn C/C++ programming under Linux platform?
12
by: etam | last post by:
Hi, I am a .NET programmer and I have to create a very big web application. The problem is that available servers are using Linux. Is there any way to run my ASP.NET application, written using...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.