Solved

how can i clone this : dosread, doswrite in AIX  "C"?

Posted on 1998-04-01
7
422 Views
Last Modified: 2011-09-20
i want access to device fd0 (3.5 floppy disk)?.
how can i do that?
gracias.
0
Comment
Question by:navi_ivan
7 Comments
 
LVL 4

Expert Comment

by:jos010697
ID: 2009061
Devices (like /dev/fd0) are usually accessed using open/close read/write system
calls. Additional functions can be performed by the device using ioctl system
calls. If you just want to read files from the floppy disk, 'mount' it. If you just
want to dump the raw filing system on the disk, check out 'dd'.

Check your man pages for open, close, read, write, ioctl, fcntl, mount, dd ...

kind regards,

Jos aka jos@and.nl
0
 
LVL 1

Expert Comment

by:markus_baertschi
ID: 2009062
I suppose you want to read and write DOS-style diskettes from
within your program. The easiest way is to call the aix dosread/doswrite
executables from your own c program. Check out the 'system' subroutine
in info on how to do this.
Jos is certainly correct that you can read/write using direct aix kernel
calls, but this will not provide you direct access to the (dos) files
on the diskette. You would have to analyze the FAT filesystem and
code all this into your C program. This is probably overkill and certainly
a lot of work. You would gain a better control over the diskette access
and could probably provide better error-recovery, etc this way.
There are the commands 'mdir', 'mcopy', etc. who provide the same
functions on linux. You can get the source and incorporate what you need into
your program, too.
Markus
0
 

Author Comment

by:navi_ivan
ID: 2009063
please, give me a example
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
LVL 1

Expert Comment

by:Talence
ID: 2009064
You want an example program for open/read/write or do you want
to know how to mount floppies as well? I don't think what you
are trying to do is very hard, but it would be nice if you would
be more specific in your question.

0
 

Author Comment

by:navi_ivan
ID: 2009065
ok.
just tell me how can i get list of files (ls -l), from fd0(flopply disk); in AIX i must write the command "dosdir".
0
 
LVL 1

Accepted Solution

by:
markus_baertschi earned 100 total points
ID: 2009066
Hi navi_van,

  here an example in C source code:

#include <stdio.h>
main () {
  char *cmd = "dosdir";
  printf ("Running command %s \n",cmd);
  system (cmd);
}

  Markus
0
 

Author Comment

by:navi_ivan
ID: 2009067
markus. that was the first i did but i want to know how can i do it whitout "system", just pure "C".
because i need do this
dosread (get the file)
doswrite (download the file)
dosdel (erase the u know)
dosformat (format the floppy dos style).

sorry if i can not be more specific, my inglish is not well.
thaks.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In tuning file systems on the Solaris Operating System, changing some parameters of a file system usually destroys the data on it. For instance, changing the cache segment block size in the volume of a T3 requires that you delete the existing volu…
My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (http://www.experts-exchange.com/articles/OS/Unix/Solaris/Installing-the-Solaris-OS-From-the-Flash-Archive-on-a-Tape.html), discussed installing the Solaris Operating S…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

792 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question