![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| mount -o llock -F nfs vs mount -F nfs | KhawHL | UNIX for Dummies Questions & Answers | 1 | 01-15-2008 08:48 PM |
| how i prepare a c++ code(c code) for implementing my own protocol format | amitpansuria | High Level Programming | 1 | 09-06-2007 08:09 PM |
| SSH key code versus server key code | Texan | Security | 1 | 04-12-2006 08:57 AM |
| how does unix identify C and other language code! | a25khan | UNIX for Dummies Questions & Answers | 2 | 01-21-2004 06:44 AM |
| how to mount a hotswap scsi drive on a solaris 2.6 netra box using the mount command? | soulshaker | UNIX for Dummies Questions & Answers | 4 | 07-18-2001 10:11 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
code mount in c language
HI All:
Where I can find out the mount lib or function to view because I think about using c to mount a file system without shell command. Thanks Last edited by jeter; 03-15-2006 at 12:22 PM. |
| Forum Sponsor | ||
|
|
|
|||
|
Hi All:
I am coming here again ,i have viewed doucment and write a code as following. but the program con not runs, I have tryed login super user. thanks #include <sys/param.h> #include <sys/mount.h> #include <errno.h> #include <string.h> int main() { const char path[]="data/test/my"; const char Workstationpath[]="/export/home/data/testpgm/"; // a location computer int flag; if ((flag = mount(Workstationpath,path,"MNT_RDONLY"))) printf("message %s",strerror(errno)); return 0; } |
|
|||
|
I modify the code as following
produce a message : "Invalid argument " #include <sys/param.h> #include <sys/mount.h> #include <errno.h> #include <string.h> int main() { const char javapath[]="data/test/my";//need to be mounted const char workstationpath[]="/export/home/testpgm/"; int flag; if ((flag = mount("MNT_RDONLY",workstationpath,javapath))) printf("PLEASE LOGIN SUPER SUER %s",strerror(errno)); return 0; } Thanks |
|
|||
|
I'll try this one last time. You C code needs:
Code:
system("/usr/sbin/mount <put your options & arguments here>");
Calling mount() will probably not do what you want, if I understand what you are doing. |
|||
| Google The UNIX and Linux Forums |