FileCreationMode Enum

Definition

Enumerates values returned by several types and taken as a parameter of several types.

This enumeration supports a bitwise combination of its member values.

[System.Flags]
public enum FileCreationMode
[<System.Flags>]
type FileCreationMode = 
Inheritance
FileCreationMode
Attributes

Fields

Name Value Description
Private 0

File creation mode: the default mode, where the created file can only be accessed by the calling application (or all applications sharing the same user ID).

WorldReadable 1

This constant was deprecated in API level 17. Creating world-readable files is very dangerous, and likely to cause security holes in applications. It is strongly discouraged; instead, applications should use more formal mechanism for interactions such as ContentProvider , BroadcastReceiver , and Service . There are no guarantees that this access mode will remain on a file, such as when it goes through a backup and restore. File creation mode: allow all other applications to have read access to the created file. Starting from Build.VERSION_CODES.N , attempting to use this mode throws a SecurityException . See also: FileProvider Intent.FLAG_GRANT_WRITE_URI_PERMISSION Constant Value: 1 (0x00000001)

WorldWriteable 2

This constant was deprecated in API level 17. Creating world-writable files is very dangerous, and likely to cause security holes in applications. It is strongly discouraged; instead, applications should use more formal mechanism for interactions such as ContentProvider , BroadcastReceiver , and Service . There are no guarantees that this access mode will remain on a file, such as when it goes through a backup and restore. File creation mode: allow all other applications to have write access to the created file. Starting from Build.VERSION_CODES.N , attempting to use this mode will throw a SecurityException . See also: FileProvider Intent.FLAG_GRANT_WRITE_URI_PERMISSION Constant Value: 2 (0x00000002)

MultiProcess 4

This constant was deprecated in API level 23. MODE_MULTI_PROCESS does not work reliably in some versions of Android, and furthermore does not provide any mechanism for reconciling concurrent modifications across processes. Applications should not attempt to use it. Instead, they should use an explicit cross-process data management approach such as ContentProvider . SharedPreference loading flag: when set, the file on disk will be checked for modification even if the shared preferences instance is already loaded in this process. This behavior is sometimes desired in cases where the application has multiple processes, all writing to the same SharedPreferences file. Generally there are better forms of communication between processes, though. This was the legacy (but undocumented) behavior in and before Gingerbread (Android 2.3) and this flag is implied when targeting such releases. For applications targeting SDK versions greater than Android 2.3, this flag must be explicitly set if desired. See also: getSharedPreferences(String, int) Constant Value: 4 (0x00000004)

EnableWriteAheadLogging 8

Database open flag: when set, the database is opened with write-ahead logging enabled by default.

NoLocalizedCollators 16

Database open flag: when set, the database is opened without support for localized collators.

Append 32768

File creation mode: for use with openFileOutput(String, int) , if the file already exists then write data to the end of the existing file instead of erasing it.

Remarks

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to