making dir or ls command using C interrupts

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • haroonob
    New Member
    • Feb 2008
    • 4

    making dir or ls command using C interrupts

    hello
    i have to made a program which show list of folders and files using in interrupt in C language can any buddy help me

    Haroon Idrees
  • sicarie
    Recognized Expert Specialist
    • Nov 2006
    • 4677

    #2
    I'm sorry, I don't understand what you are trying to do? Are you attempting to create your own version of those commands? Or are you trying to do something else?

    Comment

    • haroonob
      New Member
      • Feb 2008
      • 4

      #3
      I want to make simple C Program which show current directories and files like dir or ls .This should be use interrupt for getting current directory and its subdirectories and files.Help me to make this program. I Saw 21h interrupt with its service 47h and 4Eh .

      Thanks

      Comment

      • ashitpro
        Recognized Expert Contributor
        • Aug 2007
        • 542

        #4
        Originally posted by haroonob
        I want to make simple C Program which show current directories and files like dir or ls .This should be use interrupt for getting current directory and its subdirectories and files.Help me to make this program. I Saw 21h interrupt with its service 47h and 4Eh .

        Thanks

        ls command belongs to linux,
        Do you really believe that it uses DOS interrupts(in linux) to get the output.?
        this link will help you
        http://www.frontiernet .net/~fys/filedir.htm

        Comment

        • haroonob
          New Member
          • Feb 2008
          • 4

          #5
          I made a program for getting current directory but it is not working

          #include <stdio.h>
          #include <string.h>
          #include <dir.h>
          #include <dos.h>
          union REGS inregs, outregs;
          void main(){
          inregs.h.ah = 0x47;
          int86(0x21,&inr egs,&outregs);
          printf("%s",out regs.x.si);
          }

          it prints (null)Null pointer assignment

          Comment

          Working...