?
Solved

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

Posted on 1998-04-01
7
Medium Priority
?
428 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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 200 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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

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…
Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Suggested Courses

765 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