{"json_modified": "2016-10-05T02:27:14.186067", "uuid": "7b36cff8-9279-45ae-b38d-cf229907cbac", "title": "OS.File for the main thread", "url": "/en-US/docs/Mozilla/JavaScript_code_modules/OSFile.jsm/OS.File_for_the_main_thread", "tags": ["Guide", "Method", "JavaScript"], "translations": [{"uuid": "39c3d49d-02d3-4ff8-bb42-00aa96eef288", "title": "OS.File pour le thread principal", "url": "/fr/docs/Mozilla/JavaScript_code_modules/OSFile.jsm/OS.File_for_the_main_thread", "tags": [], "summary": "Cette page explique comment utiliser File I/O depuis le thread principal. Pour d'autres utilisations de OS.File, voir OS.File.", "localization_tags": ["inprogress"], "locale": "fr", "last_edit": "2016-07-13T00:25:31", "review_tags": []}, {"uuid": "b4afb488-a305-4f3c-865c-7cfeef026f22", "title": "OS.File for the main thread", "url": "/sv-SE/docs/Mozilla/JavaScript_code_modules/OSFile.jsm/OS.Fil_f%C3%B6r_main_thread", "tags": [], "summary": "Denna Sida visa detaljer om hur man anv\u00e4nder File I/O fr\u00e5n main thread. F\u00f6r andra anv\u00e4ndningsomr\u00e5de av File.I/O bes\u00f6k\u00a0the corresponding page.", "localization_tags": ["inprogress"], "locale": "sv-SE", "last_edit": "2016-01-28T22:49:10", "review_tags": []}], "modified": "2016-10-05T02:27:13", "label": "OS.File for the main thread", "localization_tags": [], "locale": "en-US", "id": 56843, "last_edit": "2016-10-05T02:27:06", "summary": "This page details how to use File I/O from the main thread. For other uses of OS.File, please see the corresponding page.", "sections": [{"id": "Using_OS.File_from_the_Add-On_SDK", "title": "Using OS.File from the Add-On SDK"}, {"id": "Using_OS.File_from_a_JSM", "title": "Using OS.File from a JSM"}, {"id": "Promises", "title": "Promises"}, {"id": "Example_Read_the_contents_of_a_file_as_text", "title": "Example: Read the contents of a file as text"}, {"id": "Example_Write_a_string_to_a_file", "title": "Example: Write a string to a file"}, {"id": "Example_Rename_a_file", "title": "Example: Rename a file"}, {"id": "Example_Copy_a_file", "title": "Example: Copy a file"}, {"id": "Example_Path_manipulation", "title": "Example: Path manipulation"}, {"id": "Example_Determine_if_a_file_is_a_directory", "title": "Example: Determine if a file is a directory"}, {"id": "Example_copy_a_file_by_chunks", "title": "Example: copy a file by chunks"}, {"id": "Example_Save_Canvas_to_Disk", "title": "Example: Save Canvas to Disk"}, {"id": "Example_Append_to_File", "title": "Example: Append to File"}, {"id": "Global_object_OS.File", "title": "Global object OS.File"}, {"id": "Method_overview", "title": "Method overview"}, {"id": "Methods", "title": "Methods"}, {"id": "OS.File.open()", "title": "OS.File.open()"}, {"id": "Arguments", "title": "Arguments"}, {"id": "Promise_resolves_to", "title": "Promise resolves to"}, {"id": "Example_of_opening_file_and_keeping_it_locked", "title": "Example of opening file and keeping it locked"}, {"id": "OS.File.openUnique()", "title": "OS.File.openUnique()"}, {"id": "Arguments_2", "title": "Arguments"}, {"id": "Promise_resolves_to_2", "title": "Promise resolves to"}, {"id": "Promise_can_be_rejected_with", "title": "Promise can be rejected with"}, {"id": "OS.File.copy()", "title": "OS.File.copy()"}, {"id": "Arguments_3", "title": "Arguments"}, {"id": "Promise_can_be_rejected_with_2", "title": "Promise can be rejected with"}, {"id": "OS.File.exists()", "title": "OS.File.exists()"}, {"id": "Arguments_4", "title": "Arguments"}, {"id": "Promise_resolves_to_3", "title": "Promise resolves to"}, {"id": "OS.File.getCurrentDirectory()", "title": "OS.File.getCurrentDirectory()"}, {"id": "Promise_resolves_to_4", "title": "Promise resolves to"}, {"id": "OS.File.makeDir()", "title": "OS.File.makeDir()"}, {"id": "Arguments_5", "title": "Arguments"}, {"id": "OS.File.move()", "title": "OS.File.move()"}, {"id": "Arguments_6", "title": null}, {"id": "Promise_can_be_rejected_with_3", "title": "Promise can be rejected with"}, {"id": "OS.File.read()", "title": "OS.File.read()"}, {"id": "Arguments_7", "title": "Arguments"}, {"id": "Promise_resolves_to_5", "title": "Promise resolves to"}, {"id": "Promise_can_be_rejected_with_4", "title": "Promise can be rejected with"}, {"id": "Arguments_8", "title": "Arguments"}, {"id": "OS.File.remove()", "title": "OS.File.remove()"}, {"id": "Arguments_9", "title": "Arguments"}, {"id": "Promise_can_be_rejected_with_5", "title": "Promise can be rejected with"}, {"id": "OS.File.removeEmptyDir()", "title": "OS.File.removeEmptyDir()"}, {"id": "Arguments_10", "title": "Arguments"}, {"id": "Promise_can_be_rejected_with_6", "title": "Promise can be rejected with"}, {"id": "OS.File.removeDir()", "title": "OS.File.removeDir()"}, {"id": "Arguments_11", "title": "Arguments"}, {"id": "Promise_can_be_rejected_with_7", "title": "Promise can be rejected with"}, {"id": "OS.File.setCurrentDirectory()", "title": "OS.File.setCurrentDirectory()"}, {"id": "Arguments_12", "title": "Arguments"}, {"id": "Promise_can_be_rejected_with_8", "title": "Promise can be rejected with"}, {"id": "OS.File.setDates()", "title": "OS.File.setDates()"}, {"id": "Arguments_13", "title": "Arguments"}, {"id": "Promise_can_be_rejected_with_9", "title": "Promise can be rejected with"}, {"id": "OS.File.setPermissions()", "title": "OS.File.setPermissions()"}, {"id": "Arguments_14", "title": "Arguments"}, {"id": "Promise_can_be_rejected_with_10", "title": "Promise can be rejected with"}, {"id": "OS.File.stat()", "title": "OS.File.stat()"}, {"id": "Arguments_15", "title": "Arguments"}, {"id": "Promise_resolves_to_6", "title": "Promise resolves to"}, {"id": "Promise_can_be_rejected_with_11", "title": "Promise can be rejected with"}, {"id": "OS.File.unixSymLink()", "title": "OS.File.unixSymLink()"}, {"id": "Arguments_16", "title": "Arguments"}, {"id": "Promise_resolves_to_7", "title": "Promise resolves to"}, {"id": "Promise_can_be_rejected_with_12", "title": "Promise can be rejected with"}, {"id": "OS.File.writeAtomic()", "title": "OS.File.writeAtomic()"}, {"id": "Arguments_17", "title": "Arguments"}, {"id": "Promise_can_be_rejected_with_13", "title": "Promise can be rejected with"}, {"id": "Instances_of_OS.File", "title": "Instances of OS.File"}, {"id": "Methods_overview", "title": "Methods overview"}, {"id": "Methods_2", "title": "Methods"}, {"id": "close()", "title": "close()"}, {"id": "flush()", "title": "flush()"}, {"id": "getPosition()", "title": null}, {"id": "Promise_resolves_to_8", "title": "Promise resolves to"}, {"id": "Promise_can_be_rejected_with_14", "title": "Promise can be rejected with"}, {"id": "read()", "title": "read()"}, {"id": "Arguments_18", "title": "Arguments"}, {"id": "Promise_resolves_to_9", "title": "Promise resolves to"}, {"id": "Promise_can_be_rejected_with_15", "title": "Promise can be rejected with"}, {"id": "setDates()", "title": "setDates()"}, {"id": "Arguments_19", "title": "Arguments"}, {"id": "Promise_can_be_rejected_with_16", "title": "Promise can be rejected with"}, {"id": "setPosition()", "title": "setPosition()"}, {"id": "Arguments_20", "title": "Arguments"}, {"id": "Promise_can_be_rejected_with_17", "title": "Promise can be rejected with"}, {"id": "stat()", "title": "stat()"}, {"id": "Promise_resolves_to_10", "title": "Promise resolves to"}, {"id": "Promise_can_be_rejected_with_18", "title": "Promise can be rejected with"}, {"id": "write()", "title": "write()"}, {"id": "Arguments_21", "title": "Arguments"}, {"id": "Promise_resolves_to_11", "title": "Promise resolves to"}, {"id": "Promise_can_be_rejected_with_19", "title": "Promise can be rejected with"}], "slug": "Mozilla/JavaScript_code_modules/OSFile.jsm/OS.File_for_the_main_thread", "review_tags": []}