Skip to content

Conversation

@YoheiKakiuchi
Copy link
Contributor

If the file name ends with ".zip", it is saved as a zip archive.

The save service called as

save("filename.zip")

'filename.zip' will be created.
It contains 'filename.log_portname0', ... , 'filename.log_portnameN'.

@Naoki-Hiraoka
Copy link
Contributor

Naoki-Hiraoka commented Mar 24, 2023

ログの容量が大きいと制御PCでsaveしてから遠隔PCに送るのに時間がかかるので圧縮できると便利だと思うのですが、

HRP2の制御PCでビルドしようとすると、

hrpsys/rtc/DataLogger/DataLogger.cpp:16:17: error: zip.h: No such file or directory

というエラーがでました。

break;
}
// set no-compression mode
if ( zip_set_file_compression(zipf, index, ZIP_CM_STORE, 0) < 0 ) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Naoki-Hiraoka
log保存時に現状より余分に時間がかかってしまうので無圧縮にしています。
ZIP_CM_DEFAULT にすると圧縮します。
https://libzip.org/documentation/zip_set_file_compression.html

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ログの容量が大きいと制御PCでsaveしてから遠隔PCに送るのに時間がかかるので圧縮できると便利だと思うのですが、

このPRはログを圧縮するのが目的かと勘違いして、この機能は便利でいいですね という意図で書いたのですが、勘違いでした。すみません。

ログを1つにまとめられる、ということですね。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

圧縮と無圧縮どちらが良いかは環境に依存しそうで、サービスで設定できるようにするのが筋だろうとは思っていました。

@YoheiKakiuchi
Copy link
Contributor Author

aptでlibzip-devが入るでしょうか?
随分前からあるライブラリだとは思いますが、制御PCだと無い可能性があるのかな。

@Naoki-Hiraoka
Copy link
Contributor

aptでlibzip-devが入るでしょうか?
随分前からあるライブラリだとは思いますが、制御PCだと無い可能性があるのかな。

制御PCだと無いようです。また、osのバージョンが古く、aptが使えません。

JSKにあるHRP2についてはzipをソースからインストールすることは可能だと思います。(よそのHRP2やhironxなどがどうかは僕にはわからないです..)

@emijah
Copy link

emijah commented Mar 24, 2023 via email

@YoheiKakiuchi
Copy link
Contributor Author

makeできなくなる環境がありそうなので、ヘッダファイル確認してifdefで囲んだりする必要がありそうですね。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants