Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

reading unix files on windows.

Posted on 2000-03-09
10
Medium Priority
?
1,252 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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 200 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

721 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