Git Product home page Git Product logo

Comments (2)

humphd avatar humphd commented on May 29, 2024

We won't want to do it this way, but out of interest, I tried using the WebSQL shim at http://nparashuram.com/IndexedDBShim/ and in Safari on OS X 10.6.8 it fails 10 tests:

52 specs | 10 failing
fs should have a root directory.
timeout: timed out after 5000 msec waiting for test to complete
fs.writeFile, fs.readFile should write, read a utf8 file without specifying utf8 in writeFile.
timeout: timed out after 5000 msec waiting for test to complete
fs.writeFile, fs.readFile should write, read a utf8 file with "utf8" option to writeFile.
timeout: timed out after 5000 msec waiting for test to complete
fs.writeFile, fs.readFile should write, read a utf8 file with {encoding: "utf8"} option to writeFile.
timeout: timed out after 5000 msec waiting for test to complete
fs.writeFile, fs.readFile should write, read a binary file.
timeout: timed out after 5000 msec waiting for test to complete
fs.read should read data from a file.
timeout: timed out after 5000 msec waiting for test to complete
fs.read should update the current file position.
timeout: timed out after 5000 msec waiting for test to complete
fs.lseek should set the current position if whence is SET.
timeout: timed out after 5000 msec waiting for test to complete
fs.lseek should update the current position if whence is CUR.
timeout: timed out after 5000 msec waiting for test to complete
fs.lseek should update the current position if whence is END.
timeout: timed out after 5000 msec waiting for test to complete

And this was on the console:

0
idbfs.js:8742TypeError: 'undefined' is not an object (evaluating 'fileData.subarray')
IndexedDBShim.min.js:20
idbfs.js:8742TypeError: 'undefined' is not an object (evaluating 'fileData.subarray')
IndexedDBShim.min.js:20
idbfs.js:8742TypeError: 'undefined' is not an object (evaluating 'fileData.subarray')

Which is failing in:

    function handle_file_data(error, result) {
      if(error) {
        callback(error);
      } else {
        fileData = result;
    var _position = (!(undefined === position || null === position)) ? position : ofd.position;
        length = (_position + length > buffer.length) ? length - _position : length;
/** Here... **/
        var dataView = fileData.subarray(_position, _position + length); // <--------------------
        buffer.set(dataView, offset);
        if(undefined === position) {
          ofd.position += length;
        }
        callback(undefined, length);
      }
    }
  }

Code is in my websql-shim branch: https://github.com/humphd/idbfs/compare/websql-shim?expand=1

from filer.

modeswitch avatar modeswitch commented on May 29, 2024

I've started abstracting out the idb-specific parts, so it might be worth trying this by hand rather than debugging the shim.

from filer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.