Solved

reading unix files on windows.

Posted on 2000-03-09
10
1,225 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
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
 
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Add content to output file 4 58
no14 challenge 14 56
twoTwo  challenge 35 86
wordcount challenge 11 76
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…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

705 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