cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jasongin <...@git.apache.org>
Subject [GitHub] cordova-plugin-file pull request: adding sample section to readme
Date Mon, 04 Apr 2016 20:12:32 GMT
Github user jasongin commented on a diff in the pull request:

    https://github.com/apache/cordova-plugin-file/pull/176#discussion_r58439895
  
    --- Diff: README.md ---
    @@ -538,3 +540,263 @@ Android also supports a special filesystem named "documents", which
represents a
     * `root`: The entire device filesystem
     
     By default, the library and documents directories can be synced to iCloud. You can also
request two additional filesystems, `library-nosync` and `documents-nosync`, which represent
a special non-synced directory within the `/Library` or `/Documents` filesystem.
    +
    +## Sample: Create Files and Directories, Write, Read, and Append files ##
    +
    +The File plugin allows you to do things like store files in a temporary or persistent
storage location for your app (sandboxed storage). The code snippets in this section demonstrate
different tasks including:
    +* Accessing the file system
    +* Using cross-platform Cordova file URLs to store your files (see _Where to Store Files_
for more info)
    +* Creating files and directories
    +* Writing to files
    +* Reading files
    +* Appending files
    +
    +## Create a persistent file
    +
    +Before you can use the File plugin APIs, you must get access to the file system using
`requestFileSystem`. When you do this, you can request either persistent or temporary storage.
Persistent storage will not be removed unless permission is granted by the user.
    --- End diff --
    
    That's not accurate. It's possible to use window.resolveLocalFileSystemURL() to get DirectoryEntry
and FileEntry objects that you can read and write without ever calling window.requestFileSystem()
first. You may even request a persistent or temporary path using cdvfile://localhost/persistent/
or cdvfile://localhost/temporary/. It's unfortunately confusing that there is more than one
way to do the same thing, although each of those 2 APIs can do some things that the other
can't.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


Mime
View raw message