Solved

reading unix files on windows.

Posted on 2000-03-09
10
1,229 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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ADO Memory leak with DELPHI 2007 37 181
repeatEnd java challenge 42 84
only14 challenge 19 75
Fibonacci challenge 11 121
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
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.

786 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