Solved

reading unix files on windows.

Posted on 2000-03-09
10
1,236 Views
Last Modified: 2013-12-26
how can I open the unix files on windows platform? If I want to write an application for this, can is it possible programming in Java and what all basic file system knowledge is required?
0
Comment
Question by:ashish_bansal
[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
10 Comments
 
LVL 3

Expert Comment

by:mliberi
ID: 2600771
A unix file is simply a string og bytes. Windows concept of file is exactly the same. So, open unix files just as thay was windows files.

A little difference is about TEXT files. Unix uses <LF> (ascii 10) as line terminator, Windows uses <CR><LF> (ascii 13 10).
0
 
LVL 3

Expert Comment

by:ufolk123
ID: 2603338
Hi ashish,

You are not very clear.
Do you want to write a utility to convery a file of Unix to windows or
want to open a file lying on Unix machine on NT?


Please give more information on your requirement.
0
 
LVL 1

Expert Comment

by:ntdragon
ID: 2608080
you can write a prog in c\c++ even in unix that open's a file it will work in windows platform as well

if in c++ or<use g++ compiler in unix>
you can use the class ifstream that in
fstream.h

#include <fstream.h>

int main(){
   ifstream f("path\filename");
   ifstream fp;
   fp.open("path\filename",ios::binary);
   //then you can use the func to read
   //or the operator >>

return 0;
}
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 10

Expert Comment

by:rbr
ID: 2619364
Pls give more info. Your question is not very clear.
0
 
LVL 11

Expert Comment

by:alexo
ID: 2631043
ashish, there is no such thing as a "unix file".

There are text files that use a "Unix line terminator convention".  I.e., LF is used as an end-of-line marker instead of a CR+LF pair that is used in DOS, Windows, OS/2 etc.

There are also certain file systems used on Unix platform.

Which one interests you.

Incidently, you seem to have abandoned Q.10308075 on a similar subject.  Please revisit it.
0
 

Author Comment

by:ashish_bansal
ID: 2631284
What I actually meant by opening a unix file in windows is that if there is a floppy or CD which is unix or linux formatted then it cannot be read on windows platform and vice-versa. How can we thus read the contents of floppy or CD formatted on windows on linux or unix.
0
 
LVL 3

Expert Comment

by:jyu_88
ID: 2631606
mostly CD will be ISO9660 format with some extension, thus should be available on any OS which supports ISO9660 such as windows, linux and most UNIXs.  If a CD or a floppy is in a raw format of
file system unknown to the OS, then, you are right, it could be hard to read.

Windows lack support for other file systems. Linux doesnot. Linux support DOS,FAT16, FAT32(?), NTFS. If you have dos floppy or CDROM (iso9660 with Juliet extension, most likely),

on your Linux box, to view your windows CD/floppy, you have to superuser to do the following unless you've set special permission for some ordinary user.
1) mount -t vfat /dev/fd0 /mnt/floppy
2) mount -t iso9660 /dev/cdrom /mnt/cdrom

then you can access files at /mnt/floppy or /mnt/cdrom.
1) cd /mnt/floppy && ls -aF --color
2) cd /mnt/cdrom && ls -af --color

Some window manager will have GUI interface allow to click click thing, you can do that too. for instance, with RH6+, you can click on the cdrom icon on your desktop, then choose 'open' or 'mount'.
0
 
LVL 4

Expert Comment

by:Nazdor
ID: 2632057
The problem you might have is when trying to 'double click' the file to view it in windows.

Don't.

Windoze only looks at the three letter extension of a file to see how to open it, eg (.txt -> Notepad, .xls -> Excel).  Unix system don't have this problem because they either look at the file's cookie or are entered directly (eg, `cat file`).

Try creating a shortcut to c:\windows\notepad on your desktop and drag the files over that - or use the "open with" and specify always open in notepad.  (Shift+Right Click the file).
0
 

Accepted Solution

by:
onalenna earned 100 total points
ID: 2636714
Download the latest version of Ftp_Pro
and you can easily view,delete,transfer files(binary or ascii transfer) between UNIX and windows Platforms.Files are normally viewed on a notepad.
The windows interface makes Ftp_Pro quite easy to use.
Oh... the site to download fron is
http//www.csra.net/junodj/ws_ftp.htm

Good Luck
0
 

Expert Comment

by:jpjpjp
ID: 2652349
If you want to write your own program that does that, you can use a socket
connection between the unix box and the windows box. You will have to write a little program on the unix machine that reads the files and send the content on the socket, and make it the way u want.

The windows app will get the data from the socket...

WIN     ----- tcp/ip ---- Unix

Your unix process could be there waiting  for the windows app to connect (or, if you need multiple file transfer at the same time, you could have a pool of unix  apps waiting for the windows apps to connect.

The unix app could also be called by RPC  from the windows box.  




0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
sum13 challenge 24 135
twoTwo  challenge 35 113
mapBully challenge 6 178
moto 4g phone enable finger print 4 48
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

726 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