diff options
author | Edoardo La Greca | 2025-08-11 19:58:19 +0200 |
---|---|---|
committer | Edoardo La Greca | 2025-08-11 19:58:19 +0200 |
commit | 02fba54aecae044744fe5b6137769b6cf25830ce (patch) | |
tree | c056a4d854558cf775dac7f0ffced3fdb514687e | |
parent | ae4ec897ccd1d85a7d7b1a4ecb36739307326c65 (diff) |
remove parsing raw stat bytes
-rw-r--r-- | src/main/kotlin/Connection.kt | 43 |
1 files changed, 1 insertions, 42 deletions
diff --git a/src/main/kotlin/Connection.kt b/src/main/kotlin/Connection.kt index 33c3a2d..c3d3684 100644 --- a/src/main/kotlin/Connection.kt +++ b/src/main/kotlin/Connection.kt @@ -299,48 +299,7 @@ class Connection(transLay: TransportLayer) : ProtocolTranslator { val nstat = imsg.fieldsInt["nstat"]!!.toInt().toUInt() imsg.applyField(InMessage.Field("stat", InMessage.Field.Type.RAW, nstat)) val rawStat = imsg.fieldsRaw["stat"]!!.toList() - - var offset = 0 - val qid = QID(rawStat.slice(0..<13)) - offset += 13 - val mode = FilePermissions(rawStat.slice(offset+0..<offset+4)) - offset += 4 - - val intFielSizes = listOf(4, 4, 8) - val intFields: MutableList<BigInteger> = mutableListOf() - for (size in intFielSizes) { - intFields.add(InMessage.convInteger(rawStat, offset, size)) - offset += size - } - val atime = intFields[0].toInt().toUInt() - val mtime = intFields[1].toInt().toUInt() - val length = intFields[2].toLong().toULong() - - val strAmount = 4 - val strFields: MutableList<String> = mutableListOf() - for (i in 0..strAmount) { - val str = InMessage.convString(rawStat, offset) - strFields.add(str) - offset += str.length - } - val name = strFields[0] - val uid = strFields[1] - val gid = strFields[2] - val muid = strFields[3] - - val stat = Stat( - fid, - qid, - mode, - atime, - mtime, - length, - name, - uid, - gid, - muid - ) - return stat + return Stat(fid, rawStat) } override fun wstat(path: String) { |