1/* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 * You can obtaone at http://mozilla.org/MPL/2.0/. */ 4 5/** 6 * Options for nsINativeOSFileInternals::Read 7 */ 8[GenerateInit] 9dictionary NativeOSFileReadOptions 10{ 11 /** 12 * If specified, convert the raw bytes to a String 13 * with the specified encoding. Otherwise, return 14 * the raw bytes as a TypedArray. 15 */ 16 DOMString? encoding; 17 18 /** 19 * If specified, limit the number of bytes to read. 20 */ 21 unsigned long long? bytes; 22}; 23 24/** 25 * Options for nsINativeOSFileInternals::WriteAtomic 26 */ 27[GenerateInit] 28dictionary NativeOSFileWriteAtomicOptions 29{ 30 /** 31 * If specified, specify the number of bytes to write. 32 * NOTE: This takes (and should take) a uint64 here but the actual 33 * value is limited to int32. This needs to be fixed, see Bug 1063635. 34 */ 35 unsigned long long? bytes; 36 37 /** 38 * If specified, write all data to a temporary file in the 39 * |tmpPath|. Else, write to the given path directly. 40 */ 41 DOMString? tmpPath = null; 42 43 /** 44 * If specified and true, a failure will occur if the file 45 * already exists in the given path. 46 */ 47 boolean noOverwrite = false; 48 49 /** 50 * If specified and true, this will sync any buffered data 51 * for the file to disk. This might be slower, but safer. 52 */ 53 boolean flush = false; 54 55 /** 56 * If specified, this will backup the destination file as 57 * specified. 58 */ 59 DOMString? backupTo = null; 60}; 61