I need the source code of a program which formats a floppy disk. Thank you.
I need the source code of a program which formats a floppy disk. Thank you.
Learn C++ (C++ Books, C Books, FAQ, Forum Search)
Code painter latest version on sourceforge DOWNLOAD NOW!
Download FSB Data Integrity Tester.
Siavosh K C
for dos/windows computersCode:int main() { system("format a:") }
I need a ticket for the lottery that is a winner.
Originally Posted by WraithanCode:int main() { system("mktick lotto winner") }
Sent from my iPadŽ
j00 R t2h h3xing!
Why is that? As indicated, you can usually use a system call or the like.I need the source code of a program which formats a floppy disk.
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.
I never use system call (not safe, not needed). When you tell system "format a:", system executes a program, I need it's source code.
I didn't say I need to format a floppy disk.
And about the ticket, please open your needs in a new thread. Don't ***** mine.
Last edited by siavoshkc; 02-15-2006 at 01:29 AM.
Learn C++ (C++ Books, C Books, FAQ, Forum Search)
Code painter latest version on sourceforge DOWNLOAD NOW!
Download FSB Data Integrity Tester.
Siavosh K C
Well posting a request like that without any showing of even attempting to solve the problem yourself. Not even something that would open up a connection to the disk drive. Ask for something and expect everyone to do the work for you, and expect someone to "*****" your thead.
To address your question, linux is open source therefore, with some work you can probably find the source on your own.
Do you know why system calls are unsafe? I'd think you don't because there is nothing unsafe about the program Daryll wrote. Secondly, if you're going to be vauge about your question, don't be rude when you don't get the answer your looking for. Lastly, if you can't tell the difference between a joke and thread hijack, then you really need to work on your sense of humor.Originally Posted by siavoshkc
Sent from my iPadŽ
seriously, I don't see why you need it, but to bring up some issues with your post.Originally Posted by siavoshkc
This board isn't here to hand you code, if you want that, use google. The primary puprose of this board, at least from what I have seen, is to help people learn, understand, correct problems they are making with something they are actively working on.
Also, your question is overly vauge, I don't even know what OS your asking about, and since fomating a device requires system calls, and I'm not talking about system(), if you don't know what I'm talking about you shouldn't even be asking for these questions, unless your writing the OS yourself, which I doubt in this case.
If any part of my post is incorrect, please correct me.
This post is not guarantied to be correct, and is not to be taken as a matter of fact, but of opinion or a guess, unless otherwise noted.
System calls are unsafe. You are passing the command to the shell and just maybe the exe you think you are using is not what it appears to be.
There are ways to format the drive under the API.
SlyMaelstroms, sending command to cmd (not system calls) is unsafe because command interpreter could be replaced by another program that may cause damage to the system or do whatever it wants (Thanks to Salem). Yes I didn't lough, internet is very expensive here.
Xipher, you can see my OS is in my signature.
Anyway I want to have direct access to the floppy drive. I know it is not simple. Xipher, I know it needs a system call. I thought exploring the code of a program that formats a disk will help me.
Wraithan, I asked my question here because I thought someone here may know a link to somewhere or has a ready code that could be sent here. I didn't expect anyone to do my works, because nobody can.
Last edited by siavoshkc; 02-17-2006 at 11:10 AM.
Learn C++ (C++ Books, C Books, FAQ, Forum Search)
Code painter latest version on sourceforge DOWNLOAD NOW!
Download FSB Data Integrity Tester.
Siavosh K C
In my second post I meant calling system() not system call. I thought dwks was on the same point.
Learn C++ (C++ Books, C Books, FAQ, Forum Search)
Code painter latest version on sourceforge DOWNLOAD NOW!
Download FSB Data Integrity Tester.
Siavosh K C
>>sending command to cmd (not system calls) is unsafe because command interpreter could be replaced by another program that may cause damage to the system or do whatever it wants
So what? if that happens then the computer has a lot bigger problems then some program using system calls! That should be the least of a programmer's worries.