本文整理汇总了C++中PROJECT::write_symlink_for_project_file方法的典型用法代码示例。如果您正苦于以下问题:C++ PROJECT::write_symlink_for_project_file方法的具体用法?C++ PROJECT::write_symlink_for_project_file怎么用?C++ PROJECT::write_symlink_for_project_file使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PROJECT
的用法示例。
在下文中一共展示了PROJECT::write_symlink_for_project_file方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: create_and_delete_pers_file_xfers
//.........这里部分代码省略.........
// and make PERS_FILE_XFERs for them
//
for (i=0; i<file_infos.size(); i++) {
fip = file_infos[i];
pfx = fip->pers_file_xfer;
if (pfx) continue;
if (fip->downloadable() && fip->status == FILE_NOT_PRESENT) {
pfx = new PERS_FILE_XFER;
pfx->init(fip, false);
fip->pers_file_xfer = pfx;
pers_file_xfers->insert(fip->pers_file_xfer);
action = true;
} else if (fip->uploadable() && fip->status == FILE_PRESENT && !fip->uploaded) {
pfx = new PERS_FILE_XFER;
pfx->init(fip, true);
fip->pers_file_xfer = pfx;
pers_file_xfers->insert(fip->pers_file_xfer);
action = true;
}
}
// Scan existing PERS_FILE_XFERs, looking for those that are done,
// and deleting them
//
vector<PERS_FILE_XFER*>::iterator iter;
iter = pers_file_xfers->pers_file_xfers.begin();
while (iter != pers_file_xfers->pers_file_xfers.end()) {
pfx = *iter;
// If the transfer finished, remove the PERS_FILE_XFER object
// from the set and delete it
//
if (pfx->pers_xfer_done) {
fip = pfx->fip;
if (pfx->is_upload) {
// file has been uploaded - delete if not sticky
//
if (!fip->sticky) {
fip->delete_file();
}
fip->uploaded = true;
active_tasks.upload_notify_app(fip);
} else if (fip->status >= 0) {
// file transfer did not fail (non-negative status)
// If this was a compressed download, rename .gzt to .gz
//
if (fip->download_gzipped) {
char path[MAXPATHLEN], from_path[MAXPATHLEN], to_path[MAXPATHLEN];
get_pathname(fip, path, sizeof(path));
snprintf(from_path, sizeof(from_path), "%s.gzt", path);
snprintf(to_path, sizeof(to_path), "%s.gz", path);
boinc_rename(from_path, to_path);
}
// verify the file with RSA or MD5, and change permissions
//
retval = fip->verify_file(true, true, true);
if (retval == ERR_IN_PROGRESS) {
// do nothing
} else if (retval) {
msg_printf(fip->project, MSG_INTERNAL_ERROR,
"Checksum or signature error for %s", fip->name
);
fip->status = retval;
} else {
// Set the appropriate permissions depending on whether
// it's an executable or normal file
//
retval = fip->set_permissions();
fip->status = FILE_PRESENT;
}
// if it's a user file, tell running apps to reread prefs
//
if (fip->is_user_file) {
active_tasks.request_reread_prefs(fip->project);
}
// if it's a project file, make a link in project dir
//
if (fip->is_project_file) {
PROJECT* p = fip->project;
p->write_symlink_for_project_file(fip);
p->update_project_files_downloaded_time();
}
}
iter = pers_file_xfers->pers_file_xfers.erase(iter);
delete pfx;
action = true;
// `delete pfx' should have set pfx->fip->pfx to NULL
assert (fip == NULL || fip->pers_file_xfer == NULL);
} else {
++iter;
}
}
return action;
}