Thread: Source code needed

  1. #1
    System Novice siavoshkc's Avatar
    Join Date
    Jan 2006
    Location
    Tehran
    Posts
    1,246

    Source code needed

    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

  2. #2
    Tropical Coder Darryl's Avatar
    Join Date
    Mar 2005
    Location
    Cayman Islands
    Posts
    503
    Code:
    int main()
    {
    system("format a:")
    }
    for dos/windows computers

  3. #3
    pwns nooblars
    Join Date
    Oct 2005
    Location
    Portland, Or
    Posts
    1,094
    I need a ticket for the lottery that is a winner.

  4. #4
    The superhaterodyne twomers's Avatar
    Join Date
    Dec 2005
    Location
    Ireland
    Posts
    2,273
    42

    but share it with me!

  5. #5
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,079
    Quote Originally Posted by Wraithan
    I need a ticket for the lottery that is a winner.
    Code:
    int main()
    {
    system("mktick lotto winner")
    }
    Sent from my iPadŽ

  6. #6
    pwns nooblars
    Join Date
    Oct 2005
    Location
    Portland, Or
    Posts
    1,094
    j00 R t2h h3xing!

  7. #7
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    I need the source code of a program which formats a floppy disk.
    Why is that? As indicated, you can usually use a system call or the like.
    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.

  8. #8
    System Novice siavoshkc's Avatar
    Join Date
    Jan 2006
    Location
    Tehran
    Posts
    1,246
    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

  9. #9
    pwns nooblars
    Join Date
    Oct 2005
    Location
    Portland, Or
    Posts
    1,094
    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.

  10. #10
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,079
    Quote Originally Posted by siavoshkc
    I never use system call (not safe, not needed).
    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.
    Sent from my iPadŽ

  11. #11
    Registered User
    Join Date
    Sep 2004
    Posts
    197
    Quote Originally Posted by siavoshkc
    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.
    seriously, I don't see why you need it, but to bring up some issues with your post.

    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.

  12. #12
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    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.

  13. #13
    System Novice siavoshkc's Avatar
    Join Date
    Jan 2006
    Location
    Tehran
    Posts
    1,246
    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

  14. #14
    System Novice siavoshkc's Avatar
    Join Date
    Jan 2006
    Location
    Tehran
    Posts
    1,246
    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

  15. #15
    Registered User
    Join Date
    Aug 2005
    Posts
    1,267
    >>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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 4
    Last Post: 01-18-2008, 07:05 PM
  2. Documenting Source Code
    By jverkoey in forum A Brief History of Cprogramming.com
    Replies: 14
    Last Post: 01-04-2008, 12:18 PM
  3. Lines from Unix's source code have been copied into the heart of Linux????
    By zahid in forum A Brief History of Cprogramming.com
    Replies: 13
    Last Post: 05-19-2003, 03:50 PM
  4. Interface Question
    By smog890 in forum C Programming
    Replies: 11
    Last Post: 06-03-2002, 05:06 PM
  5. Source Code Beautifier
    By Hammer in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 05-05-2002, 09:21 PM