语言

Menu
Sites
Language
How to break copy the file

How to break copy the big file?

And not wait SuccessCallback to delete them.

响应

3 回复
Alex Dem

Hi,

I think you need to detect file size at first. The File interface contains readonly fileSize attribute. If desired file so big you could refuse from copying at once:

How to detect file size:
var file;
try {
file = documentsDir.resolve('sample-text-file.txt');
console.log('File size: ' + file.fileSize);
} catch (exc) {
console.log('Could not resolve file: ' + exc.message);

// Stop in case of any errors
return;
}


please watch these articles also:
https://developer.tizen.org/help/index.jsp?topic=%2Forg.tizen.web.device.apireference%2Ftizen%2Ffilesystem.html
https://developer.tizen.org/documentation/articles/how-access-tizen-file-system

Alexey.

Sergey

Thanx for answer.

But I want abort process of copy. When he is started already.

Alex Dem

I did not find such api to detect 'is file copying now' and 'break copying' both for web and native applications
Alexey.