You really can't - there is no "default file permission" on POSIX systems.
File permissions are set when the file is created with either the open()
/openat()
or creat()
function.
Per the open()
specifications (note the bolded part, added to emphasize where file permission bits come from):
O_CREAT
If the file exists, this flag has no effect except as noted under
O_EXCL
below. Otherwise, if O_DIRECTORY
is not set the file shall
be created as a regular file; the user ID of the file shall be set to
the effective user ID of the process; the group ID of the file shall
be set to the group ID of the file's parent directory or to the
effective group ID of the process; and the access permission bits
(see <sys/stat.h>) of the file mode shall be set to the value of
the argument following the oflag
argument taken as type mode_t
modified as follows: a bitwise AND is performed on the file-mode bits
and the corresponding bits in the complement of the process' file mode
creation mask. ...
The application creating the file picks the file's initial permissions, but with the bits that are non-zero in the process umask
setting set to zero.
There is no "default" permission setting.
cron
job to monitor a directory every1
min for new files, then usefind
to list files only, piping toxargs
to change permissions [find . -type f -name '*' | xargs chmod 777
]. As @harrymc mentioned, Windows is the only OS that requires execute permissions to open files, so if this is for a Windows share, use Samba and specify in thesmb.conf
create mask = 0777
Traverse folder / execute file
is removed, so isModify
, and is why at least700
is required when modifying files in a Linux Samba share from Windows (at least in Samba v3, as OpenWrt's v4 port isn't stable quite yet)