Python Forum
Failing to get Stat for a Directory
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Failing to get Stat for a Directory
#8
(Jul-20-2021, 06:08 AM)tester_V Wrote: I'd like to find Directories that have size=0.

Why? What do you think that means? You can't use that to find directories that have no children. You can't use that to find directories that have empty files. So I don't think looking for it is useful.

Quote:Some of the directories have files, empty files, files that have a size=0.
Yes, but that is the file that has size==0, not the directory. You need to iterate in the directory and look for every file inside that has st_size==0. That's what my previous example does.

Quote:'C:\02\zero' is a subdirectory of "02" directory, it is my testing subdirectory and I called it 'zero'.
I was wondering if I can do that (find directories the size=0) with "pathlib.Path"

You can, but I don't see how it would be useful to do so.
Reply


Messages In This Thread
Failing to get Stat for a Directory - by tester_V - Jul-20-2021, 01:50 AM
RE: Failing to get Stat for a Directory - by bowlofred - Jul-20-2021, 06:47 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Failing to connect by 'net use' tester_V 1 315 Apr-20-2024, 06:31 AM
Last Post: tester_V
  Failing regex tester_V 3 1,284 Aug-16-2022, 03:53 PM
Last Post: deanhystad
  Unknown Error with Random Stat Assigner FC8 6 2,434 Dec-06-2021, 01:56 PM
Last Post: FC8
  Failing to connect to a host with WMI tester_V 6 4,555 Aug-10-2021, 06:25 PM
Last Post: tester_V
  Failing to Zip files tester_V 4 2,261 Dec-01-2020, 07:28 AM
Last Post: tester_V
  Python 3.8 on mac failing to start sgandon 0 3,045 Jan-14-2020, 10:58 AM
Last Post: sgandon
  trying to install oandapy and failing ErnestTBass 0 1,995 Feb-24-2019, 06:13 PM
Last Post: ErnestTBass
  Pyinstaller failing JP_ROMANO 2 4,164 Jan-16-2019, 06:07 PM
Last Post: JP_ROMANO
  Why is my for loop failing? microphone_head 4 3,063 Sep-11-2018, 01:21 PM
Last Post: microphone_head

Forum Jump:

User Panel Messages

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