В настоящее время у меня есть веб-приложение, которое может читать и записывать файлы на Samsung Tizen TV v2.4 (прошивка: T-HKMLAKUC-1006.4)
Добавление наведения, похоже, не работает.
Я могу сделать следующее без каких-либо проблем:
tizen.filesystem.resolve('documents/log.txt', (file) => {
file.openStream("w", (fs) => {
fs.write('Tizen .. '); // Works
console.log('written to log Tizen ... '); // View if its running the code block
// This block is ran as i get the console log from this function
}, (e) => {
console.log("Error " + e.message);
// No Errors thrown
}, "UTF-8");
}, (e) => {
// No Errors thrown
}, "a");
Если я изменю «w» на «a», который должен добавляться к файлу, файл будет пустым.
tizen.filesystem.resolve('documents/log.txt', (file) => {
file.openStream("a", (fs) => {
console.log('written to log Tizen ... '); // View if its running the code block
// This block is ran as i get the console log from this function
fs.write('Tizen .. '); // When i read it nothing here
}, (e) => {
console.log("Error " + e.message);
}, "UTF-8");
});
Кто-нибудь еще видел эту проблему? Спасибо
Если я отслеживаю журналы консоли из этой функции, я получаю следующее:
4:59:21 pm | YaBRm3kxLCctUNmhl034oLe0QQA= | "" // View the file
4:59:21 pm | YaBRm3kxLCctUNmhl034oLe0QQA= | "running append to file" // Run the append function
4:59:21 pm | YaBRm3kxLCctUNmhl034oLe0QQA= | "written to log Tizen ... " // Append function shows its running the success block
4:59:22 pm | YaBRm3kxLCctUNmhl034oLe0QQA= | "Tizen .. " // View the file (and its appended)
4:59:23 pm | YaBRm3kxLCctUNmhl034oLe0QQA= | "running append to file" // Run the append function again
4:59:23 pm | YaBRm3kxLCctUNmhl034oLe0QQA= | "written to log Tizen ... " // Shows its running the append function correctly
4:59:24 pm | YaBRm3kxLCctUNmhl034oLe0QQA= | "" // View the file and its empty