Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Recursively create a file
#14
Everthought about using functions?

def createdir(d):
    original_umask_p = os.umask(0)
    os.makedirs(d, mode=0777)
    os.umask(original_umask_p)
But you can set the umask() for the whole app on startup. And no need to restore it since it is set only for the process.
Unless noted otherwise, code in my posts should be understood as "coding suggestions", and its use may require more neurones than the two necessary for Ctrl-C/Ctrl-V.
Your one-stop place for all your GIMP needs: gimp-forum.net
Reply


Messages In This Thread
Recursively create a file - by digitalquake - Nov-02-2016, 12:00 PM
RE: Recursively create a file - by Ofnuts - Nov-02-2016, 05:21 PM
RE: Recursively create a file - by digitalquake - Nov-02-2016, 06:16 PM
RE: Recursively create a file - by Ofnuts - Nov-02-2016, 06:33 PM
RE: Recursively create a file - by digitalquake - Nov-03-2016, 10:02 AM
RE: Recursively create a file - by wavic - Nov-03-2016, 11:08 AM
RE: Recursively create a file - by Ofnuts - Nov-03-2016, 02:10 PM
RE: Recursively create a file - by digitalquake - Nov-03-2016, 04:29 PM
RE: Recursively create a file - by Ofnuts - Nov-03-2016, 10:26 PM
RE: Recursively create a file - by digitalquake - Nov-09-2016, 06:35 PM
RE: Recursively create a file - by digitalquake - Nov-14-2016, 03:44 PM
RE: Recursively create a file - by metulburr - Nov-14-2016, 04:08 PM
RE: Recursively create a file - by digitalquake - Nov-25-2016, 10:43 AM
RE: Recursively create a file - by Ofnuts - Nov-25-2016, 02:52 PM
RE: Recursively create a file - by digitalquake - Nov-25-2016, 03:46 PM
RE: Recursively create a file - by nilamo - Dec-06-2016, 07:59 PM
RE: Recursively create a file - by Ofnuts - Nov-25-2016, 10:07 PM
RE: Recursively create a file - by digitalquake - Nov-28-2016, 09:27 AM
RE: Recursively create a file - by digitalquake - Dec-07-2016, 11:22 AM
RE: Recursively create a file - by Larz60+ - Dec-07-2016, 06:08 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Create Choices from .ods file columns cspower 3 652 Dec-28-2023, 09:59 PM
Last Post: deanhystad
  Recommended way to read/create PDF file? Winfried 3 2,951 Nov-26-2023, 07:51 AM
Last Post: Pedroski55
  Use PM4PY and create working file thomaskissas33 0 721 Nov-14-2023, 06:53 AM
Last Post: thomaskissas33
  Create csv file with 4 columns for process mining thomaskissas33 3 800 Nov-06-2023, 09:36 PM
Last Post: deanhystad
  create exe file for linux? korenron 2 1,000 Mar-22-2023, 01:42 PM
Last Post: korenron
  my first file won't create itself MehHz2526 2 927 Nov-27-2022, 12:58 AM
Last Post: MehHz2526
  Create multiple/single csv file for each sql records mg24 6 1,452 Sep-29-2022, 08:06 AM
Last Post: buran
Sad pandas writer create "corrupted" file freko75 1 2,867 Jun-14-2022, 09:57 PM
Last Post: snippsat
  How to return the next page from json recursively? sandson 0 1,189 Apr-01-2022, 11:01 PM
Last Post: sandson
  create new log file on logging? korenron 6 2,357 Mar-22-2022, 07:14 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