VictoriaFreSh 2024.9.16 → 2024.9.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/victoriafresh.rb +30 -14
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6e0b92b20d099ee3450a94adaae6d3ae6cbba886548bb902bc02f9d2fe7d85a0
|
|
4
|
+
data.tar.gz: 06e05bd4399e4d9f5bee76458e1debed3f94509654d8d386613ada9f88d4c7ae
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d3fd6678851937db82070f655b63ac3e95a930bf23ae652006c7d9054cea99a4d1dbe1cbb633acec40cd629ad2e1eb4ccaf8a82c302c399f322bff73d8995d1d
|
|
7
|
+
data.tar.gz: 418f0848f48210c0ca5fc325b7721e9a8b238dd3e7c390552a678056137739a5108ba29094b3dd0c3d6e78f4f436dff6f8127ada84950147f889ea838acb4b70
|
data/lib/victoriafresh.rb
CHANGED
|
@@ -336,7 +336,7 @@ class VictoriaFresh
|
|
|
336
336
|
end #if (bufferLength>=@diskFlushSize) #缓冲区总长度已经超过需要的文件长度
|
|
337
337
|
|
|
338
338
|
if (isFinalPart) #是最后一部分
|
|
339
|
-
|
|
339
|
+
@contentString = @contentPartArray.join #重组成整个字符串
|
|
340
340
|
|
|
341
341
|
@contentPartArray.clear #清空字符串数组
|
|
342
342
|
@bufferLength=0 #缓冲区长度归零
|
|
@@ -345,19 +345,35 @@ class VictoriaFresh
|
|
|
345
345
|
|
|
346
346
|
@contentString="" #字符串清空
|
|
347
347
|
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
348
|
+
if (@diskMultiFile) #多个磁盘文件
|
|
349
|
+
begin
|
|
350
|
+
# 打开文件
|
|
351
|
+
@diskWriteFileObject = File.new("#{@diskFileName}#{@currentDiskFlushSuffix}.v", 'wb')
|
|
352
|
+
|
|
353
|
+
# 增加计数
|
|
354
|
+
@currentDiskFlushSuffix += 1
|
|
355
|
+
|
|
356
|
+
# 写入内容
|
|
357
|
+
@diskWriteFileObject.syswrite(contentToWrite)
|
|
358
|
+
|
|
359
|
+
# 关闭文件
|
|
360
|
+
@diskWriteFileObject.close
|
|
361
|
+
rescue Errno::EACCES => e
|
|
362
|
+
# 处理权限不足的情况
|
|
363
|
+
puts "Error: Unable to create or write to the file #{@diskFileName}#{@currentDiskFlushSuffix}.v - Permission denied."
|
|
364
|
+
puts e.message
|
|
365
|
+
raise # 重新引发异常
|
|
366
|
+
rescue StandardError => e
|
|
367
|
+
# 处理其他标准错误
|
|
368
|
+
puts "Error: An error occurred while creating or writing to the file #{@diskFileName}#{@currentDiskFlushSuffix}.v."
|
|
369
|
+
puts e.message
|
|
370
|
+
raise # 重新引发异常
|
|
371
|
+
end
|
|
372
|
+
else #单个磁盘文件
|
|
373
|
+
@diskWriteFileObject.syswrite(contentToWrite) #写入内容
|
|
374
|
+
|
|
375
|
+
@diskWriteFileObject.close #关闭文件
|
|
376
|
+
end #if (@diskMultiFile) #多个磁盘文件
|
|
361
377
|
end #if (isFinalPart) #是最后一部分
|
|
362
378
|
end #if (@diskFlush) #要做磁盘写入
|
|
363
379
|
end #contentString= assessDiskFlush(contentString) #考虑是否要向磁盘先输出内容
|