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

In summary, 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.
  • #1
WWGD
Science Advisor
Gold Member
7,006
10,459
TL;DR Summary
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: 196
  • IMG_20191119_185344_01.jpg
    IMG_20191119_185344_01.jpg
    38.2 KB · Views: 216
Technology news on Phys.org
  • #2
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 WWGD
  • #3
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 jedishrfu
  • #4
Yeah, I've done that disaster "waiting to happen" where you save the wrong copy to file.
 
  • #5
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 WWGD
  • #6
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.
 
  • #7
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 WWGD
  • #8
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.
 

1. What is the purpose of having different files with the same name in Python 2.7 Jupyter?

Having different files with the same name in Python 2.7 Jupyter allows you to organize your code and data in a more efficient and logical manner. It also helps to avoid confusion and makes it easier to find and access specific files.

2. How can I differentiate between the files with the same name in Python 2.7 Jupyter?

In order to differentiate between the files with the same name in Python 2.7 Jupyter, you can add a unique identifier or a version number to the file name. This will make it easier to identify and access the specific file that you need.

3. Can I have files with the same name but different extensions in Python 2.7 Jupyter?

Yes, you can have files with the same name but different extensions in Python 2.7 Jupyter. This can be useful when working with different types of data or code that require different file formats.

4. How do I ensure that I am working with the correct file in Python 2.7 Jupyter?

In order to ensure that you are working with the correct file in Python 2.7 Jupyter, you can use the "rename" function to give the file a more specific and distinguishable name. You can also use the "ls" command to list all the files in your current directory and check the file names.

5. Is it possible to have multiple files with the same name and content in Python 2.7 Jupyter?

Yes, it is possible to have multiple files with the same name and content in Python 2.7 Jupyter. However, it is not recommended as it can cause confusion and make it difficult to manage and organize your files.

Similar threads

  • Programming and Computer Science
Replies
17
Views
1K
  • Programming and Computer Science
Replies
12
Views
6K
Replies
6
Views
639
  • Programming and Computer Science
Replies
9
Views
861
  • Programming and Computer Science
Replies
3
Views
2K
  • Programming and Computer Science
Replies
3
Views
311
  • Programming and Computer Science
Replies
6
Views
1K
  • Programming and Computer Science
Replies
4
Views
5K
  • Programming and Computer Science
Replies
6
Views
1K
  • Programming and Computer Science
3
Replies
75
Views
4K
Back
Top