473,396 Members | 1,921 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,396 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 1401
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
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.