mirror of
https://git.mirrors.martin98.com/https://github.com/luc-github/ESP3D.git
synced 2025-08-13 06:09:06 +08:00
add check if filesystem error
This commit is contained in:
parent
cecd0a9de0
commit
2933e406fb
@ -190,8 +190,14 @@ void HTTP_Server::handleFSFileList ()
|
||||
}
|
||||
}
|
||||
buffer2send += "],\"path\":\"" + path + "\",";
|
||||
buffer2send += "\"status\":\"" + status + "\",";
|
||||
|
||||
if (ESP_FileSystem::totalBytes()>0) {
|
||||
buffer2send += "\"occupation\":\"" + String(100*ESP_FileSystem::usedBytes()/ESP_FileSystem::totalBytes()) + "\",";
|
||||
} else {
|
||||
status = "FileSystem Error";
|
||||
buffer2send += "\"occupation\":\"0\",";
|
||||
}
|
||||
buffer2send += "\"status\":\"" + status + "\",";
|
||||
buffer2send += "\"total\":\"" + ESP_FileSystem::formatBytes (ESP_FileSystem::totalBytes()) + "\",";
|
||||
buffer2send += "\"used\":\"" + ESP_FileSystem::formatBytes (ESP_FileSystem::usedBytes()) + "\"}";
|
||||
path = "";
|
||||
|
Loading…
x
Reference in New Issue
Block a user