Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

mrblack927

macrumors 6502a
Original poster
Aug 19, 2008
841
34
Hi all,

I've been playing with Lion for a while now and I think I've finally figured out exactly how this new file management philosophy works with Lion. Forgive me if some of this has been posted before. I just wanted to get it all in a concise guide of sorts.

So, first of all, it should be noted that this functionality appears to be implemented via new API calls. That means that developers will have to update their apps to support it. Obviously right now the only apps that could do that are Apple apps. For this demonstration I will be using TextEdit, which appears to have everything built in already.

Here we go...

Open a new TextEdit file
Nothing new here, the app starts and you can start writing.

cO44I.png


Quit TextEdit without saving (cmd+Q)
Here's where things get weird. You would expect it to prompt you to save the file, or at least store it somewhere with Versions. But it doesn't, it just quits. Where does your file go?

Open TextEdit again
Answer: It didn't go anywhere. When you open the app again, your file is still there as if nothing changed.

cO44I.png


Even though the app was completely terminated and removed from memory, the "state" was saved. This is similar to iOS multitasking. So how do we close out this file and get rid of it? Well, it seems this is now the responsibility of the window, not the app.

Close the TextEdit window (cmd+W)
Now the app prompts you to save the file. If you choose no, the file will be trashed, otherwise, it will be saved as the name you give it. After that, you can quit the app and it will be in a "new state" the next time you open it.

3TeJy.png


Open the saved file
The file opens as normal, but now you have a little arrow in the top right corner.

t0gsy.png


This is for Versions. You can lock, revert, or compare versions by clicking on this arrow. If you lock the file, it will be in read-only mode. Versions will stop taking snapshots and any changes you make will have to either be unlocked or copied to a new file.

tm7IU.png


Editing a saved file
The neat thing about versions is that after you save it the first time (ie. give it a file name) all future saves are handled by OSX and stored with Versions. For example, textedit knows that you edited the file:

X4Kvb.png


And when you close the window (cmd+W) it will be automatically saved as a new "version". There is no prompt, and no need for user input. The next time you open the file, it will show you the latest version. If you want to see an older version, you can just click "browse all versions".

rykZZ.png


Reverting files
The Versions browser is similar to the Time Machine interface. It's a little unpolished right now (no animations), but of course this is just the first beta. Functionally, it is all there. You can "go back in time" to see older copies and even copy and paste text from a saved version to the current copy. Or revert entirely.

Click to see full screen pic of Versions

So what have we learned?
Well, some things have been considerably moved around, but all previous functionality seems to still be there, and much of it has been improved. Most notably, a lot of people have been worried that "quitting will not restore an app to a clean slate". Well, that's true, but closing all windows and then quitting will. Apple seems to be moving towards more per-window management instead of per-app. Cmd+W carries more weight now.

Edit: Also...
It turns out that you don't need to quit anymore! If you close all open windows, the app will automatically quit itself as soon as you move on to something else. For example, clicking on the Safari window causes TextEdit to quit, as long as there are no TextEdit windows open. Neat!

This is basically our first look at a new productivity paradigm. You will be able to quit all of your apps (or even restart) without fear of loosing anything. You will be able to edit things without constantly resaving. Like most things it will take some getting used to but overall it seems like a step in the right direction.

Shoot away with questions if you have any.
 
Last edited:

zorinlynx

macrumors G3
May 31, 2007
8,144
17,475
Florida, USA
How does the OS handle versions on a filesystem level? Does it store the version information in the resource fork (metadata) or does it store it somewhere else?

If you're working on a file stored on a network volume on a non-Macintosh system (linux fileserver with samba for instance) does versioning still work? Does it depend on the Apple double (._) resource forks to store the data?

I'm the sort of user who had to know how everything works. So my curiosity is on fire here!
 

mrblack927

macrumors 6502a
Original poster
Aug 19, 2008
841
34
How does the OS handle versions on a filesystem level? Does it store the version information in the resource fork (metadata) or does it store it somewhere else?

If you're working on a file stored on a network volume on a non-Macintosh system (linux fileserver with samba for instance) does versioning still work? Does it depend on the Apple double (._) resource forks to store the data?

I'm the sort of user who had to know how everything works. So my curiosity is on fire here!

Good questions. The Versions appear to be stored in a special new volume called "MobileBackups", located at /Volumes/MobileBackups. It appears to use the Time Machine subsystem to handle this which is a per-disk process so I would assume off-disk resources (such as network files) are unsupported, though I have not tested this yet. See the attached pic for a look at the MobileBackups volume. Every one of those folders contains the entire folder structure for your primary disk (in my case "SSD"). Obviously it can't back up the entire disk every hour, so I'm assuming it does a differential backup, maybe even using a special kind of symbolic link for files that haven't changed. The MobileBackups volume is kind of a mystery right now though. The file system sees it as having 0 MB free and taking up an unknown amount of space. It seems Apple is doing some magic behind the scenes there. You'd have to ask someone more well-versed in filesystem structures than me exactly what is going on.
 

kuwisdelu

macrumors 65816
Jan 13, 2008
1,323
2
It turns out that you don't need to quit anymore! If you close all open windows, the app will automatically quit itself as soon as you move on to something else. For example, clicking on the Safari window causes TextEdit to quit, as long as there are no TextEdit windows open. Neat!

Don't think I like that...
 

tourada

macrumors regular
Feb 27, 2011
160
0
Idaho
Wirelessly posted (Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_2_1 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8C148a Safari/6533.18.5)

Pages is still from '09. It has to be updated to allow for versions or any other lion feature (like fullscreen). My bet is iWork will get an update come summer
 

hellomoto4

macrumors 6502a
Jul 11, 2008
804
0
Australia
Wirelessly posted (Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_2_1 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8C148a Safari/6533.18.5)

Pages is still from '09. It has to be updated to allow for versions or any other lion feature (like fullscreen). My bet is iWork will get an update come summer

I thought that might've been the case.

As cougarcat said, it would be awesome to see it tomorrow </wishfulthinking>
 

kuwisdelu

macrumors 65816
Jan 13, 2008
1,323
2
A few questions, if anyone has answers:

Does Lion offer any finer control over how long between Auto-saves/Versions? For some documents, an hour can be a long time between saves...

Is there anyway to force a new save/version any time I want? If there's a big change I want to make, can I force an version snapshot before I make it, and then another after I make it?

Also, if I leave a file open for a long time without making changes to it, will I end up with a bunch of different versions? Or is it smart enough not to create a new version if it sees there's been no changes?

If anyone knows these or takes the time to find out, thanks!
 

Steve Ballmer

macrumors 6502
Oct 2, 2009
405
133
Redmond, WA
Ideally, by the time Lion hits GM, we'll have iWork '11 and a 64-bit Cocoa iTunes.

And thanks for this guide, I get how Versions works but it's still a bit awkward, only because I'm so used to saving every five minutes. But I'll get used to it.
 

Cougarcat

macrumors 604
Sep 19, 2003
7,766
2,553
A few questions, if anyone has answers:

Does Lion offer any finer control over how long between Auto-saves/Versions? For some documents, an hour can be a long time between saves...

Is there anyway to force a new save/version any time I want? If there's a big change I want to make, can I force an version snapshot before I make it, and then another after I make it?

You can't control how frequently it autosaves, but any time you save normally it creates a snapshot. So yes, if you are going to make a big change, Apple-S before and after will give you the snapshots you want.

Also, if I leave a file open for a long time without making changes to it, will I end up with a bunch of different versions? Or is it smart enough not to create a new version if it sees there's been no changes?

Versions is essentially time machine for documents, so yes, it's smart enough not to do that.
 

kuwisdelu

macrumors 65816
Jan 13, 2008
1,323
2
You can't control how frequently it autosaves, but any time you save normally it creates a snapshot. So yes, if you are going to make a big change, Apple-S before and after will give you the snapshots you want.

Ah, great, at first it sounded like normally saving didn't do anything if you had Versions turned on, and it only allowed auto-saving. Very glad that was just my misunderstanding. :) That's perfect. :D

Versions is essentially time machine for documents, so yes, it's smart enough not to do that.

I only use TM for backup, and haven't really needed to use it that way, so that's good to know. Thanks!
 

ErikGrim

macrumors 603
Jun 20, 2003
6,460
5,082
Brisbane, Australia
A few questions, if anyone has answers:

Does Lion offer any finer control over how long between Auto-saves/Versions? For some documents, an hour can be a long time between saves...

In addition to saving regularly, keep it mind it will always keep the latest changed to your document. The hour rate only pertains to older versions.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.