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:
abraunegg 2019-03-11 17:56:26 +11:00 committed by GitHub
parent efaaaadce2
commit 3f08e271af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);