Wanderer
Wanderer

Reputation: 147

Opening Linux file on Windows

I'm learning about ray-tracing algorithms and I came across this site. At the bottom of the page there is an available download of source code. In the tar file there is an rt file.

How do I open this file? I mean, what is it? Is it a script or a C-compiled code? Anyway, is there a way to convert this to the original source code?

Any hint appreciated, thanks in advance.

Upvotes: 1

Views: 70

Answers (2)

rrauenza
rrauenza

Reputation: 7003

The file rt is a precompiled linux binary (see below). The author included all of the compilation artifacts in the tar file, along with the source.

$ tar xf rt.tar  
$ file rayt/rt 
rayt/rt: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, BuildID[sha1]=3b7cd05d3123da4404969eb68d76ceb2858eeedd, not stripped

You can't really do much with it, although you could look into running Ubuntu on Windows 10. It uses SDL, though, and that might not work with Microsoft's Ubuntu integration.

In that case, you might give something like virtualbox a try. You could make a Linux VM. Pick a distribution that contains SDL (CentOS 7 does.)

I was able to compile it on CentOS7 by just doing g++ *.cc -lSDL, although I had to change #include <SDL.h> to #include <SDL/SDL.h> in rt.cc.

Addendum:

SDL is also available on Windows and I noticed that rt.cc has some Windows code in it. So you might be able to get this to compile directly on Windows.

Upvotes: 2

RaulTheThinker
RaulTheThinker

Reputation: 45

Use 7zip to unzip that file (or anything compatible with .tar really) . There's a 'src' folder inside

Read about .tar: https://en.wikipedia.org/wiki/Tar_(computing)

In computing, tar is a computer software utility for collecting many files into one archive file, often referred to as a tarball, for distribution or backup purposes. The name is derived from (t)ape (ar)chive, as it was originally developed to write data to sequential I/O devices with no file system of their own. The archive data sets created by tar contain various file system parameters, such as name, time stamps, ownership, file access permissions, and directory organization.

Upvotes: 0

Related Questions