You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.
We seem to be keep running into issue with the way we read and write files wrt to the "DataType" usage.
For example, jsfs always returns DataType.Value when reading files, even though they were saving with a different datatype. It begs the question of why we have a optional data type on the FileSystem.readFile function. What is the purpose?
Another issue is the GDrive file system. GDrive stores a mime type for every file, and allows specifying a "conversion" mime type when reading sheets or docs. Should we include this level abstraction into the Axiom API. How?
A proposal would be to generalize DataType to mimeType as follows:
writeFile(path, mimeType, data)
path is the file path (as usual)
mimeType is the mime type of the file
data is either a string (for text mime type) or an ArrayBuffer for all other types.
If mimeType is text, use the charset:encoding of mimeType to figure out the encoding.
readFile(path, mimeType)
path is the file path (as usual)
mimeType is optional and defines the mime type of the stored data. The file system uses mimeType encoding part as a for decoding stored text as a JavaScript string.
The return value is either a string (if mimeType is string) or an ArrayBuffer.
The text was updated successfully, but these errors were encountered:
We seem to be keep running into issue with the way we read and write files wrt to the "DataType" usage.
For example, jsfs always returns
DataType.Value
when reading files, even though they were saving with a different datatype. It begs the question of why we have a optional data type on theFileSystem.readFile
function. What is the purpose?Another issue is the GDrive file system. GDrive stores a mime type for every file, and allows specifying a "conversion" mime type when reading sheets or docs. Should we include this level abstraction into the Axiom API. How?
A proposal would be to generalize DataType to mimeType as follows:
writeFile(path, mimeType, data)
path
is the file path (as usual)mimeType
is the mime type of the filedata
is either a string (fortext
mime type) or anArrayBuffer
for all other types.mimeType
istext
, use thecharset:encoding
ofmimeType
to figure out the encoding.readFile(path, mimeType)
path
is the file path (as usual)mimeType
is optional and defines the mime type of the stored data. The file system usesmimeType
encoding part as a for decoding stored text as a JavaScript string.mimeType
is string) or anArrayBuffer
.The text was updated successfully, but these errors were encountered: