Python Forum
p]Why os.path.exists("abc/d") and os.path.exists("abc/D") treat same
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
p]Why os.path.exists("abc/d") and os.path.exists("abc/D") treat same
#1
Why os.path.exists("abc/d") and os.path.exists("abc/D") treat same but actually both are different path. Before running create abc folder and then inside abc folder create d folder to test it.
print(os.path.exists("abc/d")==os.path.exists("abc/D"))
Output it gives is true and it should be false.
Reply
#2
I guess you're on a Windows-System where the file-system is not case-sensitive.
If you want to have False as result, you've to switch to Linux, Mac or some other *bsd like system.
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Using OpenCV and image path is invalid AudunNilsen 5 456 Mar-18-2024, 05:28 PM
Last Post: snippsat
  Path Planning prachibhanaria 0 264 Jan-23-2024, 10:11 AM
Last Post: prachibhanaria
  Create dual folder on different path/drive based on the date agmoraojr 2 374 Jan-21-2024, 10:02 AM
Last Post: snippsat
  working directory if using windows path-variable chitarup 2 679 Nov-28-2023, 11:36 PM
Last Post: chitarup
  Can't Find Path hatflyer 8 948 Oct-30-2023, 06:17 AM
Last Post: Gribouillis
  os.path.join() 'NoneType' confusion gowb0w 11 1,418 Sep-22-2023, 11:13 PM
Last Post: deanhystad
  Why wont this path work one way, but will the other way? cubangt 2 623 Sep-01-2023, 04:14 PM
Last Post: cubangt
Bug tkinter.TclError: bad window path name "!button" V1ber 2 725 Aug-14-2023, 02:46 PM
Last Post: V1ber
  Boustrophedon path planning proteca 0 608 Jun-24-2023, 02:45 PM
Last Post: proteca
  does not save in other path than opened files before icode 3 833 Jun-23-2023, 07:25 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020