File manipulation routines for libts. More...
#include "libts.h"
#include <sys/stat.h>
Go to the source code of this file.
Functions | |
int | ink_fputln (FILE *stream, const char *s) |
int | ink_file_fd_readline (int fd, int bufsz, char *buf) |
int | ink_file_fd_writestring (int fd, const char *buf) |
int | ink_filepath_merge (char *path, int pathsz, const char *rootpath, const char *addpath, int flags) |
int | ink_filepath_make (char *path, int pathsz, const char *rootpath, const char *addpath) |
Add addpath to the rootpath prepending slash if rootpath is not NULL and doesn't end with the slash already and put the result into path buffer. | |
int | ink_file_fd_zerofill (int fd, off_t size) |
Resize and zero-fill the given file. | |
bool | ink_file_is_directory (const char *path) |
Return true if the path is a directory. |
File manipulation routines for libts.
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Definition in file ink_file.cc.
int ink_file_fd_readline | ( | int | fd, | |
int | bufsz, | |||
char * | buf | |||
) |
Definition at line 63 of file ink_file.cc.
Referenced by get_int64(), UpdateConfigManager::GetDataLine(), ICPConfiguration::icp_config_change_callback(), HttpBodySet::init(), plugin_init(), Store::read(), Span::read(), Store::read_config(), MultiCacheBase::read_config(), and read_MachineList().
int ink_file_fd_writestring | ( | int | fd, | |
const char * | buf | |||
) |
Definition at line 88 of file ink_file.cc.
Referenced by Store::write(), Span::write(), MultiCacheBase::write_config(), and Store::write_config_data().
int ink_file_fd_zerofill | ( | int | fd, | |
off_t | size | |||
) |
Resize and zero-fill the given file.
Returns 0 on success, errno on failure.
Definition at line 340 of file ink_file.cc.
Referenced by MultiCacheBase::mmap_data().
bool ink_file_is_directory | ( | const char * | path | ) |
Return true if the path is a directory.
Definition at line 363 of file ink_file.cc.
Referenced by parse_include_directive().
int ink_filepath_make | ( | char * | path, | |
int | pathsz, | |||
const char * | rootpath, | |||
const char * | addpath | |||
) |
Add addpath to the rootpath prepending slash if rootpath is not NULL and doesn't end with the slash already and put the result into path buffer.
If the buffer is too small to hold the resulting string, required size is returned. On success zero is returned
Definition at line 302 of file ink_file.cc.
References ink_strlcpy().
Referenced by DiagsConfig::DiagsConfig(), HttpBodySet::init(), Span::path(), plugin_load(), and SDK_API_TSfopen().
int ink_filepath_merge | ( | char * | path, | |
int | pathsz, | |||
const char * | rootpath, | |||
const char * | addpath, | |||
int | flags | |||
) |
Definition at line 99 of file ink_file.cc.
References INK_FILEPATH_NOTABOVEROOT, INK_FILEPATH_NOTABSOLUTE, INK_FILEPATH_NOTRELATIVE, INK_FILEPATH_SECUREROOTTEST, and memcpy.
Referenced by layout_relative(), Layout::relative(), and Layout::relative_to().
int ink_fputln | ( | FILE * | stream, | |
const char * | s | |||
) |
Definition at line 31 of file ink_file.cc.