VFS::TruncateFile() implemented

This commit is contained in:
Nekotekina 2015-04-18 16:38:42 +03:00
parent b1f7543436
commit f2276bb70c
7 changed files with 117 additions and 54 deletions

View file

@ -315,6 +315,18 @@ bool VFS::CopyFile(const std::string& ps3_path_from, const std::string& ps3_path
return false;
}
bool VFS::TruncateFile(const std::string& ps3_path, u64 length) const
{
std::string path;
if (vfsDevice* dev = GetDevice(ps3_path, path))
{
return rTruncate(path, length);
}
return false;
}
vfsDevice* VFS::GetDevice(const std::string& ps3_path, std::string& path) const
{
auto try_get_device = [this, &path](const std::string& ps3_path) -> vfsDevice*