mirror of
https://github.com/abraunegg/onedrive
synced 2024-05-21 15:16:36 +02:00
Update util.d - reduce local FS read overheads (#407)
* Try and read 1 byte of the file rather than 10MB for each 'new' file to be uploaded to validate local file permissions
This commit is contained in:
parent
efaaaadce2
commit
3f08e271af
|
@ -136,8 +136,9 @@ bool testNetwork()
|
|||
bool readLocalFile(string path)
|
||||
{
|
||||
try {
|
||||
// attempt to read the first 10MB of the file
|
||||
read(path,10000000);
|
||||
// attempt to read up to the first 1 byte of the file
|
||||
// validates we can 'read' the file based on file permissions
|
||||
read(path,1);
|
||||
} catch (std.file.FileException e) {
|
||||
// unable to read the new local file
|
||||
log.log("Skipping uploading this file as it cannot be read (file permissions or file corruption): ", path);
|
||||
|
|
Loading…
Reference in a new issue