Solved

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

Posted on 1998-04-01
7
415 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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
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…
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…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

757 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now