Metspitzer said:
Metspitzer wrote:
VanguardLH wrote:
Metspitzer wrote:
Windows picks a name for an untitled document. If the untilled
document exists already, why not add a 1 to the filename?
Windows does not pick names for documents. Your APPLICATION does
that but you never mentioned the application you are using.
When you load your unidentified application to create a document,
it's not likely it will consume gobs of memory in preparation for
your work on the document since it won't know the size of the
document. Your application is going to create a [sometimes
temporary] file which can be expanded as needed as you add more to
the document.
So what *application* are you using to create a new document?
Note pad
Word pad
Paint
When you open those programs, they don't create a temporary file. What
you put into the empty doc is in a buffer. You can see this by using
Nirsoft's OpenFilesViewer to see what processes have opened a file
handle. When you load Notepad, Wordpad, or Paint (without specifying a
file so you end up with a new doc when they load), they don't open a
file which assigns a handle to that object. Not until you choose to
Save [As] for that document do filenames come into play.
Some applications may create a temporary file and it's up to them to
create differently named temp files if multiple new docs are opened in
that same application and it's not using a buffer.
Those are a few
If the application is loaded without specifying a file to open, why
would there be any filename conflict when you go to save the document?
When you load the application without specifying a file, you get a blank
(untitled) document in the application. Then when you go to save your
changes, YOU will have to specify a filename. The document is untitled.
It doesn't yet have a filename associated with it. YOU had to give it a
name.
When saving the unassociated buffer into a file and after YOU specify
the filename (since it didn't have one yet), and if you specify a
filename for an already existing file, you get prompted that the file
already exists. You can choose to cancel (to pick a different path and
filename) or to overwrite the existing file. If the file already exists
and after getting the prompt that it already exists when you try to save
into the same path and filename, and if you don't want to overwrite,
then cancel and pick a different filename; for example, append "1" to
the filename that you wanted.
You open Notepad, Wordpad, or Paint. You didn't specify a filename so
the app creates a new empty doc. There is no filename conflict because
the new doc doesn't have a filename associated with it yet. Then when
you go to save the new document is when YOU are asked to specify a
filename. It's up to you what filename you give the new doc.
Maybe what you're asking is why an incremental number isn't appended
when you choose to Save As a document. Well, the app prompts YOU for
the target filename. If there's a conflict with an existing file then
YOU specify a different filename. Save [As] is not a file versioning
feature to keep appending numbers onto filenames as you repeatedly save
updated copies of a document. It uses whatever filename you specify.
Where was Windows involved in picking the filenames for Save [As] on a
new or old document?
Windows does furnish a filename if you have made a document from
scratch using Wordpad, for example. I sometimes open wordpad and jot
down a note or two. This happened yesterday when I was trying to
contact customer support. I only needed to jot down the support
number and the person's name that took the call.
The application has a default filename when you have loading that
application without specifying a filename (to open). You load the app,
you edit the doc, and when you save from that app then the app picks a
default name. The app has NOT even checked if a file by that same
filename already exists (that's what you are probably assuming). The
app doesn't know WHERE you are going to do the save until you click the
Save button at which point you have selected (by navigation or accepting
the defaults) the path and filename. Only when you press the Save
button does the app then check if it can save in that path under that
filename without a conflict. That's when it checks at the destination.
There is Browse dialog for selecting a path. That doesn't check for
conflict in filenaming since the other half of the criteria is the
filename but the Browse dialog won't know that is that actual filename
you will use. Only when you click on Save does the Browse dialog have
all the info - path and filename - to then check for conflict.
The apps don't perform file versioning either by retaining old copies of
a file under a backup somewhere or by appending numbers to the old or
new files. They just attempt to do the save that you specified. The
save will either not conflict (no existing file in the selected path has
the same name) or there is a conflict (an existing file in the selected
path has the same name). The only recourse the Browse dialog affords to
you is to change the save criteria (which includes both path and name).
You want the apps to do file versioning. They don't do that. Adding
file versioning to Windows requires using something akin to a background
always-active backup program that will retain up to some specified
maximum number of old versions for a file. However, you will need to
use that 3rd party file versioning utility to retrieve an old version of
a file.
What I do is, when I am finished making notes, just click to close the
window. Windows asks for a filename. It defaults to Document.rtf so
I just save the file as Document.rtf. If I have another occasion to
take a note or two I repeat the process. This time when I save it
Windows defaults to Document.rtf again. I get an error that the
filename already exists. I can rename it or replace it. It should
automatically pick Document(2).rtf
Yep, each *application* has its own and different default filename (but
sometimes not, as in Notepad defaults to *.txt which is obviously an
illegal filename). The application is not checking the file system
until after you click on the Save button. Only then will it know for
sure what path and name you want to use and only then will it merely
check for conflict or not. If it didn't check for conflict, users would
end up stepping atop of files they did not intend to do so. The Browse
dialog doesn't have to do the warning. It's a common safety measure to
show a prompt in case of conflict. Similarly, if you make changes to a
doc (not if you just view it) and exit the application, another safety
measure is to prompt if you want to save your changes.
The app is merely doing what you told it to do. You specified the path
and name. When you click the Save button only then does the app know
for sure what you want to use and only then does it check for conflict
or not. Again, the apps don't do file versioning. I don't recall
anyone, and especially no company, clamoring for file versioning to be
implemented within an app. Just imagine the problems with tracking
files if every app employed its own different file versioning scheme.
File versioning is something done at a lower level than at the apps.
Adding file versioning via a service or background process that is
monitoring file replacement will still not alter the behavior of the
Browse dialog in applications. You aren't changing their code. The
apps will still not check for conflict until you click the Save button.
If you use a new filename, like appending a number, then you are not
stepping atop an existing file so file versioning is not relevant. You
are saving to a new file. If, however, you get the conflict alert
prompt from the app and chose to override the file is when the file
versioning software kicks in to save the old instance of the file you
just overwrote.
In the video below, you are using Windows Explorer to access the old
versions stored in System Restore snapshots. The apps don't do the file
versioning. The OS (well, the backup or snapshot program) is saving the
old instances of an overwritten file. You'll see in the video that you
use Windows Explorer to access the file versioning support in the OS.
(at the 0:40 timemark on how to select an old overwritten version)
(at the 4:00 timemark on how to configure Backup to do file versioning)
(hey, that wasn't my choice for a desktop background)
(at 2:00 timemark, shows Previous Versions property tab on a folder)
(use the Previous Versions content menu entry for an existing file)
However, file versioning will retain only so many copies of old
instances of a file (that was repeatedly overwritten). If the app is
digging into System Restore then you only get the granularity afforded
by that function to find old versions of a file and only as far back as
System Restore retains its oldest snapshot. In UNIX, I believe (or
maybe it was Exec for the Unisys 1100 mainframes), you can enable file
versioning as part of the OS and also specify how many old versions you
can keep. The default was 3 but could be set up to 64. In Windows 7,
you use the System Restore service to keep old copies of an overwritten
file at the granularity afforded by the System Restore service.
However, although file versioning lets you access old instances of
overwritten files, you still only get one copy of the file you can
access. Consider it like a Rolodex card file where you can spin through
all the cards but you only read one at a time. These old versions do
NOT have some number appended to them. They all have the SAME filename.
Just like any backup program, you select an old instance to restore and
it steps atop the existing available copy of that file.
The applications don't do file versioning. They can't because they
won't know what different scheme might be employed by some other
application. File versioning is done in the OS (by some service or
background process that monitors file operations). File versioning
doesn't append numbers onto files but just keeps old copies of the file
and under the same name.
You could use a 3rd party backup, synchronization, or snapshot program
that is set to very small update intervals, like 5 minutes, to do
incremental backups but that will miss any changes to files between the
backups. For a real file versioning setup, you need to use a
kernel-mode driver that intercepts all file operations so the driver can
see all the file I/O requests as they occur, not poll for changes
sometime later. When the file gets changed (after releasing the handle
on the file) then the driver would save a backup copy of the old
instance before allowing saving of the new changes. The whole old file
isn't changed, just the incremental changes made to the file.
You want the apps to do the file versioning. Apps are written by
different authors so each app would employ a different file versioning
scheme. That means inconsistent methods. So apps don't do file
versioning. Something else does that either through backups and the
granularity of how often they save or through on-access methods (e.g.,
driver monitoring of system calls for file I/O) to ensure all old
instances are retained. Apps don't work at those levels.