Python Forum
How to get full path of specified hidden files matching pattern recursively
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to get full path of specified hidden files matching pattern recursively
#4
Your posted error code was a OSError: [WinError 123]
The path you've used is a path for Windows systems.

On a linux system you don't have a drive letter.
All absolute paths begins at / (the root directory).

Usually you run on linux your scripts as a user like on Windows.
So your Backupdata could be in /home/your_user_account/Backupdata
(On Windows it is C:\Users\your_user_account\Backupdata)

Using the pathlib, allows you to handle paths on windows, mac and linux in right way.

If you want to make your script os independent with the use of Path:

my_backup_dir = Path.home() / "Backupdata"
If your user home directory is named for example FooBar,
then the resulting directory on Linux is: /home/FooBar/Backupdata
And on Windows: C:\Users\FooBar\Backupdata
tester_V likes this post
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply


Messages In This Thread
RE: How to get full path of specified hidden files matching pattern recursively - by DeaD_EyE - Jan-18-2020, 02:45 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Modifying a dictionary recursively SpongeB0B 2 211 May-12-2024, 04:09 PM
Last Post: Gribouillis
  does not save in other path than opened files before icode 3 974 Jun-23-2023, 07:25 PM
Last Post: snippsat
  Copy only hidden files and folders with rsync Cannondale 2 1,077 Mar-04-2023, 02:48 PM
Last Post: Cannondale
  How to return the next page from json recursively? sandson 0 1,204 Apr-01-2022, 11:01 PM
Last Post: sandson
  Can ZipFile be used to extract hidden files? AiedailEclipsed 0 1,676 Mar-22-2022, 05:21 PM
Last Post: AiedailEclipsed
  Finding files matching pattern GrahamL 1 1,338 Jan-14-2022, 01:16 PM
Last Post: DeaD_EyE
  Help Needed | Read Outlook email Recursively & download attachment Vinci141 1 4,144 Jan-07-2022, 07:38 PM
Last Post: cubangt
  Compare filename with folder name and copy matching files into a particular folder shantanu97 2 4,594 Dec-18-2021, 09:32 PM
Last Post: Larz60+
  WebDriverException: Message: 'PATH TO CHROME DRIVER' executable needs to be in PATH Led_Zeppelin 1 2,255 Sep-09-2021, 01:25 PM
Last Post: Yoriz
  get all the files in the path in a list? korenron 23 7,340 Jul-19-2021, 07:44 AM
Last Post: korenron

Forum Jump:

User Panel Messages

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