Author Topic: Saving a netbeans project from windows to be read in linux  (Read 8488 times)

Offline fireside

  • double
  • *****
  • Posts: 607
    • View Profile
I'm having some problems with Vista.  I bought a floor model computer from Best Buy and never actually got a real copy of Vista with it.  Anyway, all has been going fairly well for a while, but I made some registry changes which apparently I shouldn't have and now they say I don't have a valid copy of Vista anymore.  My main concern right now is saving my game.  I can hopefully at least use Ubuntu, but I'm wondering how I might save my game right now.  If I write it to the cd, will Ubuntu be able to read it or is that a different file format thing?
click here->Fireside 7 Games<-

Offline C3R14L.K1L4

  • int
  • **
  • Posts: 54
    • View Profile
    • CK's place of many works
Re: Saving a netbeans project from windows to be read in linux
« Reply #1 on: May 09, 2009, 10:09:02 am »
Damn vista... I had it for a week and when I tried win7, vista got immediately kicked from my pc. I suppose you want to save your data temporarely to format the hdd or something similar... For windows systems and optical drives there are basically two file systems: CDFS (iso9660 and extensions) and UDF, which are supported in the usual linux distros. (and possibly apple's HFS, I don't know for shure this one).
If you have more than one partition (excluding vista's one with the windows folder) you can always save the data to the other one. If you reinstall vista (without formatting partitions) it only clears the windows folder and others like users data, programs (can't be shure about this one) and their data.
and there are the portable usb drives...

Oh, and you can always come back to our beloved and very old :P windows xp. If upon installing it can't detect your hard disk, use nlite and integrate your motherboard drivers (you only need the southbridge ones).
« Last Edit: May 09, 2009, 10:10:43 am by C3R14L.K1L4 »

Offline fireside

  • double
  • *****
  • Posts: 607
    • View Profile
Re: Saving a netbeans project from windows to be read in linux
« Reply #2 on: May 09, 2009, 10:50:20 am »
Thanks.  I managed to get it back by using an old back up.  I saved stuff in Windows format but that will work out now.  That was a bit scary.
click here->Fireside 7 Games<-

Offline paulscode

  • double
  • *****
  • Posts: 863
    • View Profile
    • PaulsCode.Com
Re: Saving a netbeans project from windows to be read in linux
« Reply #3 on: May 09, 2009, 03:29:30 pm »
The main problem you will encounter when transfering stuff between Microsoft, Macintosh, and Linux is that Microsoft saves ASCII text files (such as Java source code) with both a carrage return and a line feed \r\n everywhere you create a new line in your document.  In Macintosh only a carriage return \r is used, and in Linux only a line feed \n is used.

There is a historical reason why two different characters that seem to do the same thing exist in ASCII.  It is a throwback to an old pre-computer technology used by the news media for which ASCII was developed, called teletype.  These machines were basically simi-intelligent typewriters.  On a typewriter when you want to go to the next line you must return the carriage (basically the "print head") to the beginning of the line, then you must advance the paper one line.  So in a typewriter, these are two seperate and distinct functions.  When teletype met the fate of the dinosaurs and computers took over, we no longer needed two characters to represent a newline, and thus began the problem.  The reason why the different OS's represent newlines in text documents differently, is because different companies programmed them.  Obviously, these differences can make it a pain to back up source code in one OS and try to transfer it to another one.

The easiest way is to use FTP.  Most FTP clients (such as the free CoreFTP) will automatically convert ASCII files for you by default when you upload/download between operating systems.  This makes it simple to upload numerous source code files at once from one OS, then retrieve them on another OS in the correct format (not to mention this is a good way to backup your projects anyway).

If FTP is not an option for you, another option would be to zip up your project and email it to yourself.  However, it would then be necessary to manually convert between the two ASCII formats for each one of your .java files.  The most time-consuming method is to fire up NetBeans on your new OS, then go through your sourcecode line by line and press enter everywhere a new line should go.  A second option would be to take advantage of many text editors (such as Microsoft Word) which will make the conversions for you the first time you open the document.  Another method is to write a conversion program (or google one that someone else has written) which reads in a file's bytes, and when it encounters "\r\n" it replaces that with "\n" (for example).  Obviously, any of these manual conversion methods will be time consuming.

It is possible that the developers made NetBeans intelligent enough to use whatever ASCII format the sourcecode happens to be in (actually this would be extremely simple to program, it's just a matter of whether or not the developers of NetBeans considered it).  If that is the case, then all you would need to do is copy your backed-up project into the NetBeans projects directory, and you'd be good to go.

Offline fireside

  • double
  • *****
  • Posts: 607
    • View Profile
Re: Saving a netbeans project from windows to be read in linux
« Reply #4 on: May 09, 2009, 06:51:33 pm »
Thanks.  That gives me something to think about.  I'm terrible at backing things up. 
click here->Fireside 7 Games<-

Offline C3R14L.K1L4

  • int
  • **
  • Posts: 54
    • View Profile
    • CK's place of many works
Re: Saving a netbeans project from windows to be read in linux
« Reply #5 on: May 10, 2009, 11:01:13 pm »
I don't know about netbeans, as I use eclipse (only falling back to nb to create user interfaces) and eclipse loads and edits texts files independtly of it's line separator. In fact, it saves the modificated file with the same format (tested now with win/unix/mac formats).