Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 1998-04-01
7
Medium Priority
?
433 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

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.:
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.

636 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