検索クエリーを入力してください
<book_title> を検索 ...
Veritas™ File System プログラマーズリファレンスガイド - Linux
Last Published:
2018-01-16
Product(s):
InfoScale & Storage Foundation (7.3.1)
- Veritas File System Software Developer's Kit
- FCL(File Change Log)
- マルチボリュームサポート
- 名前付きデータストリーム
- Veritas File System I/O
- シン再生
アプリケーションプログラミングインターフェース
名前付きデータストリーム API は、標準のシステムコールと VxFS API コールを併用して機能を提供します。
以下に、名前付きデータストリームに問い合わせるための擬似コードの例を示します。
/* Create and open a file */
if ((fd = open("named_stream_file", O_RDWR | O_CREAT | O_TRUNC,
mode)) < 0) {
sprintf(error_buf, "%s, Error Opening File %s ", argv[0],
filename);
perror(error_buf);
exit(-1);
}
/* Write to the regular file as usual */
write(fd, buf, 1024);
/* Create several named data streams for file
named_stream_file */
for (i = 0; i < 20; i++) {
sprintf(attrname, "%s%d", "stream", i);
nfd = vxfs_nattr_open(fd, attrname, O_WRONLY | O_CREAT,
mode);
if (nfd < 0) {
sprintf(error_buf,
"%s, Error Opening Attribute file %s/./%s ",
argv[0], filename, attrname);
perror(error_buf);
exit(-1);
}
/* Write some data to the stream file */
memset(buf, 0x41 + i, 1024);
write(nfd, buf, 1024);
close(nfd);
}