![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
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 |
| Display Modes | Rate This Thread |
|
|