- file A has a guid
- you open file A
- you make some edits to this file
- you then press Save As...
- you save it to a new file B
- file B is assigned a new guid on save
1. which file does the editor have open now?
2. what happens to the guid if you then Save As onto file A?
- you open file A
- you make some edits to this file
- you then press Save As...
- you save it to a new file B
- file B is assigned a new guid on save
1. which file does the editor have open now?
2. what happens to the guid if you then Save As onto file A?
Comments
2) I would expect overwriting an existing file to keep the original file’s GUID; it should be the same as zeroing out the original bytes and writing all new content to the same GUID
You never actually open a file, you load it.
(but yes I know files load into memory, thanks, and no that's not the only time the guid will ever be used)
* be removed and not necessary.
* create a new file as: FileA (1).
most likely option 1.
1. File B is open in the editor (if behavior is different, I would expect it to be labeled “Export” or “Save a Copy” and not “Save As”)
2. Overwriting File A with save as would assign a new third GUID, which would then be open in the editor.
File B open after the initial save as operation.
When File B is saved back as File A, the original file id for ‘A’ is in use. (If File A still exists and has not been move to another volume).
Tested with notepad and fsutil, should be case for all apps though.
2. file a gets assigned a new guid and now that is what's open
nothing
1. Editor should have B open now
2. A should retain its guid
2) Depends on why the GUID is saved on the file in the first place. Probably it should be different.
State of the guid depends on if it’s based on seed data or not. Probably a new guid though.
Part of safe-save techniques can involve switching inodes.
That’s what IT always asks me. Hope this helps.
2. The guid for the saved file will be the one it had
---
Your scenario is flawed, Save As a file does not change its guid, nor uid, they both stay the same when editing and saving files in the folders of current user.
What do you even mean with guid?
- files and folders do not have guids or uids, they have inodes assigned to them
- guid (group id) and uid (user id) are the properties of file/folder pernissions, their ownership information
Even if it s a file with the same name at the same path, it is a brand new file which just happens to have the same path+name.
2) A third guid is generated
2. A content is overwritten and open.
Save a copy -> old file remains the working document
I'm not well versed in guid, but I would assume that file A keeps its guid but the contents of the file is updated to mirror file B? Seems least messy?
2. This depends if other files nest A and reference that guid. But in general I'd still vote for a stable guid per file, even if saved on top of it.
2, slightly unusual but I think file A guid should persist when the data rest of the data is saved over
If you then save the changes into the open file A, then file A gets those changes as well.
Now you have two files, A and B, with different GUIDS, that have the same information in them.
To my knowledge, 'save as' is either uniquely Windows or a product of GUI based tooling in general which is itself an abstraction on the file system operations occurring under the hood.
There is no default the system requires to do, the software can either truncate the file while keeping it in the filesystem, or delete the file and create a new one
2. It would save over your original draft
2. File A has a new guid. The first guid is lost. (If there is no bak file)
2) if the behavior of Save As is that it generates a new guid, then file A should get a new guid C. otherwise we're in weird File of Theseus territory
2. New GUID for file A. File A now open in editor.
"Save as" with an existing path is synonymous to "overwrite" an existing file. The previous file contents could be something entirely different in the meantime. Thus, also a new GUID.
At least this is what I assume logically. Never delved into file management that deeply.
...I don't know *why* I believe this...
Most people use `:w` or `:w newfile.txt` which does it just like we described and expect.
Isn't that the opposite of the behaviour that was described as expected?
Thanks. I misunderstood what you were saying.
But in 3. You save over some other existing file, that file should keep its guid.
2) FIle A gets updated with a new GUID, not necessarily the same one as File B.
2. File A gets all the data from the current file, and is now the open file
I am confused. So your view is that a "save as"program function works differently depending on the content behind a file handle?
Because that is definitely NOT what I would expect.
2nd ls - i (saved As fileB.txt)
3rd ls -i (saved As fileA.txt)
Save As is done using new inode. So, save As should create a new guid.
1) It now has File B open
2) File A is deleted and replaced with a new file and guid
If you Save As over A it destroys A and creates new A with new guid.
It can mess up your dependencies if something else depends on A but that's another issue.
2: File A was overwritten with File B, File B is now open, and File A no longer exists.
2. new GUID
2. I'd expect it to keep its initial guid
I feel 1 is pretty common. 2 I'm unsure about, in my head the guid would almost be like its filepath I guess?
2: please don't ask me or i'll cry.
2) A would then receive a new GUID, and the updated data from the B file.
If you then Overwrite A again, still generate a new guid. Who knows what messesd w/ A since we last interacted w/ it.
2) The whole point of GUID'ing is to not break references, so it should keep A's GUID. Right?
it's definitely not ideal, but neither are the alternatives
path references break constantly and are a pain to clean up, unity style .meta files have some of the same issues as in-file guids and clutter a lot
Depends on if you’re trying to encode the “name”, the “existence” or the “contents” of a file. Maybe it would be better to just hash it and use that hash if possible, but then hashes can clash.
2 should prompt that you are going to overwrite A. Essentially this should create file C with it's own guid and file A is now erased, but C has the same name, I would think.
1. Save As is the creation of a new file, so I would assume the new file with the new Guid.
2. Again I would assume new file, so I would probably make File A a new guid as well.
- I am largely a programmer, not a 3D Artist, so it my approach may not be the best for artists.
2. How is the guid used? Is it okay to regen on every save?
Is the "guid" via the filesystem? If not, it should be treated as an "id".
2. Save As onto file A steamrolls file A - it doesn't matter what was in it or what guid it had, it's all gone. The file being saved onto file A is assigned a new guid.
2. It'd overwrite with a new GUID, or it'd use the old GUID? I don't know how GUIDs work, this is just based on what I know about tech 😅🤷
2) nothing because you’re still working on file A
Save As will generally also make the newly saved file the one you're actively editing
The question is really what happens when you do "save as" and overwrite a file. Whether you are editing B or A, "Save as" should be creating a new file (which may or may not overwrite a file)
2) Change the Guid
a “save into” button to keep the guid might be useful for *some* workflow that idk about, but “save as” might not be my first thought for that
2. file A keeps its guid as though you simply replaced its contents. file B also keeps its guid