diff --git a/src/fs/fat16.cpp b/src/fs/fat16.cpp index 107318c..5aa6eb5 100644 --- a/src/fs/fat16.cpp +++ b/src/fs/fat16.cpp @@ -60,6 +60,8 @@ void fat16::init() m_Copy = cmdSupportCore; m_Backup = cmdSupportCore; m_UpdateUUID = findExternal(QStringLiteral("dd")) ? cmdSupportFileSystem : cmdSupportNone; + m_Grow = findExternal(QStringLiteral("fatresize")) ? cmdSupportFileSystem : cmdSupportNone; + m_Shrink = findExternal(QStringLiteral("fatresize")) ? cmdSupportFileSystem : cmdSupportNone; m_GetUUID = cmdSupportCore; } @@ -157,6 +159,12 @@ bool fat16::create(Report& report, const QString& deviceNode) return cmd.run(-1) && cmd.exitCode() == 0; } +bool fat16::resize(Report& report, const QString& deviceNode, qint64 length) const +{ + ExternalCommand cmd(report, QStringLiteral("fatresize"), { QStringLiteral("--verbose"), QStringLiteral("--size"), QString::number(length), deviceNode }); + return cmd.run(-1) && cmd.exitCode() == 0; +} + bool fat16::updateUUID(Report& report, const QString& deviceNode) const { qint64 t = time(nullptr); diff --git a/src/fs/fat16.h b/src/fs/fat16.h index 2bf14d7..c5a4f72 100644 --- a/src/fs/fat16.h +++ b/src/fs/fat16.h @@ -47,6 +47,7 @@ public: bool create(Report& report, const QString& deviceNode) override; bool updateUUID(Report& report, const QString& deviceNode) const override; bool writeLabel(Report& report, const QString& deviceNode, const QString& newLabel) override; + bool resize(Report& report, const QString& deviceNode, qint64 length) const override; CommandSupportType supportGetUsed() const override { return m_GetUsed;