Same file name, Different Files (Different Content) Python 2.7 Jupyt

  • Context: Python 
  • Thread starter Thread starter WWGD
  • Start date Start date
  • Tags Tags
    File files Python
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
7 replies · 2K views
Messages
7,828
Reaction score
13,156
TL;DR
Same file name for files with different content in VMWare. ????
So I have Python 2.7 ( Don't ask) installed in my VM.

Now I have two files named " Untitled 10" in my Jupyter notebook therein ( Notice the bottom cell in both files , named "Untitled 10" -- please see top of attachments -- which have different content in the "bottom-most" cell ); please see first two attachments. How can this happen? Doesn't the VM OS or something else prevent using the same name for different files?
 

Attachments

  • IMG_20191119_185344_02.jpg
    IMG_20191119_185344_02.jpg
    45.9 KB · Views: 293
  • IMG_20191119_185344_01.jpg
    IMG_20191119_185344_01.jpg
    38.2 KB · Views: 288
Physics news on Phys.org
Some file systems allow for upper and lower case filenames like linux whereas others like macos preserve the casing but balk when you try to save one over the other.

In your case do you see two files in the os environment with the same name? Or will it overwrite the contents depending on which part of your session you decide to change.

Another possibility is the file is a kind of database saving the blocks at different locs in the file.
 
  • Like
Likes   Reactions: WWGD
jedishrfu said:
Some file systems allow for upper and lower case filenames like linux whereas others like macos preserve the casing but balk when you try to save one over the other.

In your case do you see two files in the os environment with the same name? Or will it overwrite the contents depending on which part of your session you decide to change.

Another possibility is the file is a kind of database saving the blocks at different locs in the file.
Ah, I am thinking I opened up two identical copies, had them both open but made different changes to each. I need to 2-check where the Python VM files are saved to see the file structure.
 
  • Like
Likes   Reactions: jedishrfu
WWGD said:
I am thinking I opened up two identical copies, had them both open but made different changes to each.
In that case you will have only one file on disk at /notebooks/Downloads/Untitled 10.ipynb. The two "copies" are either just in memory separately or are copies/diffs in temporary files. The Untitled 10.ipynb file will have the contents of the last auto-saved tab (unless auto-save goes to the temporary files).

The structure of all of this is based on the server you have running at localhost:8888 and any code embedded in the served pages.

WWGD said:
Doesn't the VM OS or something else prevent using the same name for different files?

Yes. The client OS is Windows 7 and you can't have two of the same file. This also applies to the host Windows 10 which is the same file system.

VMWare just deals in virtual hard drives so it imposes no restriction on the structure of the client file system.

BoB
 
  • Like
Likes   Reactions: WWGD
rbelli1 said:
In that case you will have only one file on disk at /notebooks/Downloads/Untitled 10.ipynb. The two "copies" are either just in memory separately or are copies/diffs in temporary files. The Untitled 10.ipynb file will have the contents of the last auto-saved tab (unless auto-save goes to the temporary files).

The structure of all of this is based on the server you have running at localhost:8888 and any code embedded in the served pages.
Yes. The client OS is Windows 7 and you can't have two of the same file. This also applies to the host Windows 10 which is the same file system.

VMWare just deals in virtual hard drives so it imposes no restriction on the structure of the client file system.

BoB
Thanks. I ( meaning win7) have a directory 'recent' for recently used files. Hope they will both be there -- or anywhere else. I will look for them by time stamp.
 
WWGD said:
I ( meaning win7) have a directory 'recent' for recently used files.

That folder is just a bunch of shortcuts. If you have two files with the same name but different folder then the less recently opened one will get replaced in the recent files list. In any case it will not preserve any file contents.

BoB
 
  • Like
Likes   Reactions: WWGD
Thanks again. One issue I was having is that in order to save the notebook in Anaconda Python 2.7 , I must provide a path for it and was not sure on what the path should be other than some obvious choices.