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 > Top Forums > High Level Programming
.
google unix.com



High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
SSH doesn't pick up user's project from /etc/project kurgan SUN Solaris 2 05-21-2008 12:52 PM
Who know this project? Osawa UNIX for Dummies Questions & Answers 5 09-09-2007 01:08 AM
First Project help arjunjag High Level Programming 6 07-16-2007 07:10 AM
project nrusimha UNIX for Dummies Questions & Answers 1 02-07-2006 07:51 AM
Project Help Shade High Level Programming 1 12-17-2005 06:56 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 11-15-2006
ShenTech ShenTech is offline
Registered User
  
 

Join Date: Nov 2006
Posts: 3
a little project i need some help with

Hell everyone, i am trying to write a program for work, i am doing an internship there, where the program will list all the files on the Unix Server(soloaris 9) for all the engineers to look at. The code i have so far works to display all files, but the program also needs to check and see if the file is being used by another user, and if thats the case, just copy the file into there test folder where they can only read it, not edit it. If it is not being used, then the engineer will be able to copy the file onto there seat. I have never really programmed in C, so this is why i am asking for help. Thanks for all your time, and here is my code that works to display all files on the server.

#include <stdio.h>
#include <sys/types.h>
#include <dirent.h>


int main(void)
{
DIR *dir = opendir(".");
if(dir)
{
struct dirent *ent;
while((ent = readdir(dir)) != NULL)
{
puts(ent->d_name);
}
}
else
{
fprintf(stderr, "Error opening directory\n");
}





return 0;



}
 

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 08:06 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