ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Sorry by the lazyness, but is just Im needing this very quickly and there is no time to learn C, so I think that maybe someone could help me with the code to run this commmand: "mount -t msdos /dev/disk1s1 /mnt/disk".
I was thinking making in C and place in the desktop of the users (I will modify a litle the command line above) I tried just a exec file but Mac OSX opens it on the editor...
So I think that an icon on the desktop could be mutch more easy.
I thought you could click-to-execute a script the same way you click-to-execute a binary (as long as both of them have execute permissions). I haven’t used OSX in awhile, but I thought that’s how it worked.
If not, you can always use execl() in a C program:
the 0th argument is usually the basename of the file. The rest of the arguments are what you normally think of as arguments. The last parameter of the function is a 0, and tells the C library that you are done passing parameters.
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,197
Rep:
You just need to figure out how to do it properly in Mac OS X. You can have a script on the desktop that just does what it is supposed to do rather than opening the console or editor. I'd have to dig into it to see how, but the Mac specialist at work does that for the computer lab all the time.
#include "stdio.h"
main(int argc, char *argv[])
{
system("mount -t msdos /dev/disk1s1 /mnt/disk"); // consider using -t vfat
// not sure what /dev/disk1s1 refers to but i assume its like /dev/hda1
}
does mac have gcc ? i remember making a skype like script to cat /dev/dsp to an open port but mac doesnt have netcat. you might be able to compile this on linux and scp the program-binary to the mac system (it should run since osx is posix compliant and now use x86 processors). else dual boot (is there a live-cd available for mac) and use the gcc on linux to compile the program on the mac hardware after mounting the mac harddrive.
im sorry this is all theoretical but i dont have a mac to test this out on but i am still curious to know what works and what doesnt.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.