-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Various features added: -size_limit added -shuffle added -log added (screen log only, file log planned) localization module added. English and Portuguese supported. Auto localization also added (EN default) Updated: -delete_left_files updated to work with -size_limit README.md updated Improved: Exception handling improved Error messages improved
- Loading branch information
1 parent
c7c539f
commit 65a0df3
Showing
4 changed files
with
253 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# general imports | ||
import os | ||
|
||
# this function returns the current size of a folder | ||
def get_folder_size(path): | ||
s = 0.0 | ||
|
||
for entry in os.scandir(path): | ||
if entry.is_file(): | ||
s += entry.stat().st_size / 1024000 # transform from bynary bytes to decimal megabytes | ||
|
||
elif entry.is_dir(): | ||
s += get_folder_size(path + "/" + entry.name) | ||
|
||
return s | ||
|
||
# this function returns the size of a file | ||
def get_file_size(path): | ||
return os.path.getsize(path) / 1024000 # transform from bynary bytes to decimal megabytes | ||
|
Oops, something went wrong.