?
Solved

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

Posted on 1998-04-01
7
Medium Priority
?
436 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

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

A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use. However, not all UNIX file systems (UFS) can be expanded this way. The conca…
This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
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.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Suggested Courses
Course of the Month13 days, 13 hours left to enroll

755 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