semmyk commited on
Commit
5377de5
·
1 Parent(s): f748dfb

file_utils: fixing file_path.touch

Browse files
Files changed (1) hide show
  1. file_handler/file_utils.py +6 -1
file_handler/file_utils.py CHANGED
@@ -50,10 +50,15 @@ def check_create_file(filename: str, dir_path: Union[str, Path]="logs") -> Path:
50
 
51
  file_path = dir_path / filename # Concatenate directory and filename to get full path
52
  print(f"file_path: {file_path}") ##]debug
 
 
 
 
53
  if not file_path.exists(): # check if file doesn't exist
54
  file_path.touch(exist_ok=True, mode=0o2664) # Creates an empty file if it doesn't exists
55
  #file_dir.touch(mode=0o2644, exist_ok=True) #, parents=True) ##SMY: Note Permission Errno13 - https://stackoverflow.com/a/57454275
56
- #file_dir.chmod(0)
 
57
 
58
  return file_path
59
 
 
50
 
51
  file_path = dir_path / filename # Concatenate directory and filename to get full path
52
  print(f"file_path: {file_path}") ##]debug
53
+
54
+ file_path.touch(exist_ok=True, mode=0o2664) # Creates an empty file if it doesn't exists
55
+
56
+ '''
57
  if not file_path.exists(): # check if file doesn't exist
58
  file_path.touch(exist_ok=True, mode=0o2664) # Creates an empty file if it doesn't exists
59
  #file_dir.touch(mode=0o2644, exist_ok=True) #, parents=True) ##SMY: Note Permission Errno13 - https://stackoverflow.com/a/57454275
60
+ #file_dir.chmod(0)
61
+ '''
62
 
63
  return file_path
64