xxxxxxxxxx
def create_dir_recursive(root_path,create_func,callback=None,*args,**kwargs):
for path in set(os.path.dirname(path) for path in list_recursive(root_path,True)):
_path = os.path.sep if os.path.isabs(root_path) else ''
for dir_name in path.split(os.path.sep):
_path = os.path.join(_path,dir_name)
if os.path.exists(_path) is False:
create_func(path=_path)
if callback:
callback(*args,**kwargs)
xxxxxxxxxx
To create a new folder/directory
mkdir foldername
To view the contents of your folder
cd foldername -- to get inside the folder
then
ls or dir -- to view contents of the folder
To create a new file
touch example.txt -- filename and extension eg .js .html .txt
xxxxxxxxxx
$sudo mkdir -m777 newFileName
777 is the permissions given to the file
For more info:( https://www.pluralsight.com/blog/it-ops/linux-file-permissions )
xxxxxxxxxx
$ mkdir mydir
$ file mydir
mydir: directory
$ ls -l
drwxrwxr-x. 2 localuser localuser 6 Jun 9 14:47 mydir
$ cd mydir/
$ pwd
/home/localuser/mydir
$ ls -l
total 0
xxxxxxxxxx
C:\>sqlplus / as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Wed Apr 3 15:07:01 2013
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Release 11.2.0.3.0 - Production
SQL> create or replace directory MYCSV as 'e:\mycsv\';
Directory created.
SQL> grant read, write on directory MYCSV to scott;
Grant succeeded.
xxxxxxxxxx
# Python program to explain os.mkdir() method
# importing os module
import os
# Directory
directory = "GeeksforGeeks"
# Parent Directory path
parent_dir = "D:/Pycharm projects/"
# Path
path = os.path.join(parent_dir, directory)
# Create the directory
# 'GeeksForGeeks' in
# '/home / User / Documents'
os.mkdir(path)
print("Directory '% s' created" % directory)
# Directory
directory = "Geeks"
# Parent Directory path
parent_dir = "D:/Pycharm projects"
# mode
mode = 0o666
# Path
path = os.path.join(parent_dir, directory)
# Create the directory
# 'GeeksForGeeks' in
# '/home / User / Documents'
# with mode 0o666
os.mkdir(path, mode)
print("Directory '% s' created" % directory)