11 Replies - 1158 Views - Last Post: 01 July 2011 - 08:25 AM

#1 creativecoding  Icon User is offline

  • Hash != Encryption
  • member icon


Reputation: 926
  • View blog
  • Posts: 3,205
  • Joined: 19-January 10

file.... it's empty...

Posted 26 June 2011 - 07:05 PM

Well, I have a small little story to tell you.

> Just finished writing code for client
> Putting on final touches
> Final testing started
> Go to admin console - all administrator actions/forms are in this one page
> Blank page
> wtf
> Check source
> File is empty
> Use windows and check for previous version
> None
> Remember I have a backup on server
> That file is empty too
> Seriously?


This is literally the second time it's happened to me. I'm looking into some sort of automatic file back up thingy now. Set me back about 3 hours...

inb4 cool story bro
inb4 op can't inb4


Also, does this ever happen to anyone else? I suspect it's because of my below-standard router...

This post has been edited by creativecoding: 26 June 2011 - 07:08 PM


Is This A Good Question/Topic? 0
  • +

Replies To: file.... it's empty...

#2 no2pencil  Icon User is offline

  • Toubabo Koomi
  • member icon

Reputation: 5226
  • View blog
  • Posts: 27,001
  • Joined: 10-May 07

Re: file.... it's empty...

Posted 26 June 2011 - 07:11 PM

Save & save often. I don't understand how a router would clear out a file.
Was This Post Helpful? 0
  • +
  • -

#3 creativecoding  Icon User is offline

  • Hash != Encryption
  • member icon


Reputation: 926
  • View blog
  • Posts: 3,205
  • Joined: 19-January 10

Re: file.... it's empty...

Posted 26 June 2011 - 08:13 PM

View Postno2pencil, on 26 June 2011 - 08:11 PM, said:

Save & save often. I don't understand how a router would clear out a file.


For some reason my router stops working and the internet gives out and I have to reset it. I'm not sure exactly how it's writing but couldn't it be possible that in the middle of a data transfer my internet gave out and caused it to write a blank file over the existing one?
Was This Post Helpful? 0
  • +
  • -

#4 Raynes  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 611
  • View blog
  • Posts: 2,815
  • Joined: 05-January 09

Re: file.... it's empty...

Posted 26 June 2011 - 09:57 PM

Emacs automatically autosaves files every so often. I imagine Vim does or can be made to do the same thing. Beyond that, I imagine a lot of IDEs probably have similar features. If not, they should.
Was This Post Helpful? 0
  • +
  • -

#5 no2pencil  Icon User is offline

  • Toubabo Koomi
  • member icon

Reputation: 5226
  • View blog
  • Posts: 27,001
  • Joined: 10-May 07

Re: file.... it's empty...

Posted 26 June 2011 - 10:07 PM

I believe I suggested this last time. If not, please try this going forward :

Production file -> Say it's named file.txt

Copy file.txt -> file.date.txt
edit file.date.txt
copy file.date.txt -> file.txt
execute
edit file.date.txt
copy file.date.txt -> file.txt

Never touch production for test.
Was This Post Helpful? 1
  • +
  • -

#6 creativecoding  Icon User is offline

  • Hash != Encryption
  • member icon


Reputation: 926
  • View blog
  • Posts: 3,205
  • Joined: 19-January 10

Re: file.... it's empty...

Posted 26 June 2011 - 10:37 PM

Just found an automatic backup thing in notepad++, I wonder why I never turned it on.

Just for anyone who needs it:

Settings > Preferences > Backup/auto-completion
Was This Post Helpful? 0
  • +
  • -

#7 codeprada  Icon User is offline

  • Changed Man With Different Priorities
  • member icon

Reputation: 946
  • View blog
  • Posts: 2,355
  • Joined: 15-February 11

Re: file.... it's empty...

Posted 27 June 2011 - 01:20 PM

Backups shouldn't really be done on the same media as the original.
Was This Post Helpful? 0
  • +
  • -

#8 RandomlyKnighted  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 116
  • View blog
  • Posts: 1,358
  • Joined: 14-January 10

Re: file.... it's empty...

Posted 27 June 2011 - 06:46 PM

I usually copy my files to a flash drive and then remove the flash drive before I ever upload them to the server. That way if anything happens to the ones on my computer I still got them.
Was This Post Helpful? 0
  • +
  • -

#9 Curtis Rutland  Icon User is online

  • (╯□)╯︵ (~ .o.)~
  • member icon


Reputation: 4451
  • View blog
  • Posts: 7,752
  • Joined: 08-June 10

Re: file.... it's empty...

Posted 28 June 2011 - 08:37 AM

Guys...get git. Seriously, source control your own projects. Github for those you don't mind being public, and you can install your own git server (or mercurial, or SVN, or anything) at home for private stuff. No need to rely on various editors doing autosaves to locations you're not familiar with. It doesn't take much to set up your own repository, and you gain so much from it, like the peace of mind that your entire project is backed up, as well as version controlled, so you can roll back mistakes you accidentally committed.

Also, it's really really good to be able to go to your first job and not have to have them explain what source control is. It's good to be able to put on a resume that you're familiar with Git, SVN, TFS, or whatever particular source control you choose to use. At least, for your first job it is. After that it's kinda expected.
Was This Post Helpful? 1
  • +
  • -

#10 Raynes  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 611
  • View blog
  • Posts: 2,815
  • Joined: 05-January 09

Re: file.... it's empty...

Posted 29 June 2011 - 10:50 PM

From what I gather reading this thread, he was in the middle of working with his file and something wiped it. Version control wont be able to help you there. It saves what you've done, not what you're doing. If you haven't yet committed your work, you'll still lose it.

That said, Git and Github are fantastic anyway and everybody should use it. Github also supports private repositories with a paid account.
Was This Post Helpful? 0
  • +
  • -

#11 Curtis Rutland  Icon User is online

  • (╯□)╯︵ (~ .o.)~
  • member icon


Reputation: 4451
  • View blog
  • Posts: 7,752
  • Joined: 08-June 10

Re: file.... it's empty...

Posted 30 June 2011 - 06:32 AM

Granted, but if he was working on a revision rather than a brand new file, at least he'd have something to fall back to, rather than having nothing.
Was This Post Helpful? 0
  • +
  • -

#12 Raynes  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 611
  • View blog
  • Posts: 2,815
  • Joined: 05-January 09

Re: file.... it's empty...

Posted 01 July 2011 - 08:25 AM

Now that, my friend, is a valid point.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1