/commonlibrary/rust/ylong_runtime/ylong_runtime/src/fs/ |
H A D | async_dir.rs | 20 use std::path::{Path, PathBuf}; 33 /// Creates a new directory at the given path. 42 /// * The path has already been used. 43 /// * No permission to create directory at the given path. 44 /// * A parent directory in the path does not exist. In this case, use 59 pub async fn create_dir<P: AsRef<Path>>(path: P) -> io::Result<()> { 60 let path = path.as_ref().to_owned(); 61 async_op(move || std::fs::create_dir(path)).await 73 /// * The path ha 649 pub fn path(&self) -> PathBuf { path() functions [all...] |
H A D | open_options.rs | 16 use std::path::Path; 253 /// Asynchronously opens a file at `path` with the options specified by 262 /// * [`NotFound`]: One of the directory components of the file path doesn't 267 /// the directory components of the specified path. 275 /// * One of the directory components of the specified file path was not, in 279 /// long filename, too many symbolic links in the specified path 295 pub async fn open<P: AsRef<Path>>(&self, path: P) -> io::Result<File> { 296 let path = path.as_ref().to_owned(); 298 let file = async_op(move || options.open(path)) [all...] |
/commonlibrary/c_utils/base/src/ |
H A D | directory_ex.cpp | 57 rust::String RustExcludeTrailingPathDelimiter(const rust::String& path) in RustExcludeTrailingPathDelimiter() argument 59 std::string tmpPath = std::string(path); in RustExcludeTrailingPathDelimiter() 63 rust::String RustIncludeTrailingPathDelimiter(const rust::String& path) in RustIncludeTrailingPathDelimiter() argument 65 std::string tmpPath = std::string(path); in RustIncludeTrailingPathDelimiter() 69 bool RustPathToRealPath(const rust::String& path, rust::String& realPath) in RustPathToRealPath() argument 71 std::string tmpPath = std::string(path); in RustPathToRealPath() 82 void RustGetDirFiles(const rust::String& path, rust::vec<rust::String>& files) in RustGetDirFiles() argument 84 std::string tmpPath(path); in RustGetDirFiles() 128 string ExcludeTrailingPathDelimiter(const std::string& path) in ExcludeTrailingPathDelimiter() argument 130 if (path in ExcludeTrailingPathDelimiter() 141 IncludeTrailingPathDelimiter(const std::string& path) IncludeTrailingPathDelimiter() argument 153 GetDirFiles(const string& path, vector<string>& files) GetDirFiles() argument 206 ForceCreateDirectory(const string& path) ForceCreateDirectory() argument 234 ForceRemoveDirectory(const string& path) ForceRemoveDirectory() argument 336 IsEmptyFolder(const string& path) IsEmptyFolder() argument 343 GetFolderSize(const string& path) GetFolderSize() argument 373 ChangeModeDirectory(const string& path, const mode_t& mode) ChangeModeDirectory() argument 416 PathToRealPath(const string& path, string& realPath) PathToRealPath() argument [all...] |
/commonlibrary/c_utils/base/include/ |
H A D | directory_ex.h | 34 rust::String RustExcludeTrailingPathDelimiter(const rust::String& path); 35 rust::String RustIncludeTrailingPathDelimiter(const rust::String& path); 36 bool RustPathToRealPath(const rust::String& path, rust::String& realPath); 37 void RustGetDirFiles(const rust::String& path, rust::vec<rust::String>& files); 41 * @brief Obtains the full absolute path of this program. 44 * path by using readlink(). 49 * @brief Obtains the absolute path of this program. 54 * @brief Obtains the path of a file based on the full path. 59 * @brief Obtains the name of a file based on the full path [all...] |
/commonlibrary/rust/ylong_http/ylong_http_client/tests/ |
H A D | sdv_async_https_c_ssl.rs | 24 use std::path::PathBuf; 32 let mut path = PathBuf::from(dir); in sdv_async_client_send_request() variables 33 path.push("tests/file/root-ca.pem"); in sdv_async_client_send_request() 39 RootCA: path.to_str().unwrap(), in sdv_async_client_send_request() 59 RootCA: path.to_str().unwrap(), in sdv_async_client_send_request() 78 RootCA: path.to_str().unwrap(), in sdv_async_client_send_request() 98 RootCA: path.to_str().unwrap(), in sdv_async_client_send_request() 116 RootCA: path.to_str().unwrap(), in sdv_async_client_send_request() 136 let mut path = PathBuf::from(dir); in sdv_client_send_request_repeatedly() variables 137 path in sdv_client_send_request_repeatedly() 174 let mut path = PathBuf::from(dir); sdv_client_making_multiple_connections() variables [all...] |
H A D | sdv_sync_https_c_ssl.rs | 21 use std::path::PathBuf; 33 let mut path = PathBuf::from(dir); in sdv_synchronized_client_send_request() variables 34 path.push("tests/file/root-ca.pem"); in sdv_synchronized_client_send_request() 39 Tls: path.to_str().unwrap(), in sdv_synchronized_client_send_request() 59 let mut path = PathBuf::from(dir); in sdv_synchronized_client_send_request_repeatedly() variables 60 path.push("tests/file/root-ca.pem"); in sdv_synchronized_client_send_request_repeatedly() 64 Tls: path.to_str().unwrap(), in sdv_synchronized_client_send_request_repeatedly()
|
H A D | sdv_async_https_pinning.rs | 24 use std::path::PathBuf; 61 let mut path = PathBuf::from(dir); in sdv_client_public_key_pinning() variables 62 path.push("tests/file/root-ca.pem"); in sdv_client_public_key_pinning() 83 .tls_ca_file(path.to_str().unwrap()) in sdv_client_public_key_pinning() 132 .tls_ca_file(path.to_str().unwrap()) in sdv_client_public_key_pinning() 181 .tls_ca_file(path.to_str().unwrap()) in sdv_client_public_key_pinning() 261 let mut path = PathBuf::from(dir); in sdv_client_public_key_pinning_error() variables 262 path.push("tests/file/root-ca.pem"); in sdv_client_public_key_pinning_error() 265 .tls_ca_file(path.to_str().unwrap()) in sdv_client_public_key_pinning_error()
|
/commonlibrary/c_utils/base/src/rust/ |
H A D | directory_ex.rs | 14 //! Directory_ex provides an enhanced interface for some file and path related 37 /// Maximum length of a file path in characters 47 /// Get the full absolute path to the current program. 50 /// Get the absolute path of the current program. 53 /// Obtain the path to the corresponding file by the full path. 56 /// Obtain the name to the corresponding file by the full path. 60 /// path. 63 /// Determine whether the path has ended with '/', and returns the path [all...] |
/commonlibrary/c_utils/base/test/unittest/common/ |
H A D | utils_file_test.cpp | 59 bool CreateTestFile(const std::string& path, const std::string& content) in CreateTestFile() argument 61 ofstream out(path, ios_base::out | ios_base::trunc); in CreateTestFile() 67 std::cout << "open file failed!" << path << std::endl; in CreateTestFile() 71 int RemoveTestFile(const std::string& path) in RemoveTestFile() argument 73 return unlink(path.c_str()); in RemoveTestFile() 272 string path = FILE_PATH; in HWTEST_F() local 275 CreateTestFile(path, content); in HWTEST_F() 276 bool ret = SaveStringToFile(path, newContent); in HWTEST_F() 280 EXPECT_TRUE(LoadStringFromFile(path, loadResult)); in HWTEST_F() 281 RemoveTestFile(path); in HWTEST_F() 291 string path = FILE_PATH; HWTEST_F() local 310 string path = FILE_PATH; HWTEST_F() local 332 string path = FILE_PATH; HWTEST_F() local 351 string path = FILE_PATH; HWTEST_F() local 522 string path = FILE_PATH; HWTEST_F() local 541 string path = FILE_PATH; HWTEST_F() local 562 string path = FILE_PATH; HWTEST_F() local [all...] |
/commonlibrary/utils_lite/hals/file/ |
H A D | hal_file.c | 21 int HalFileOpen(const char *path, int oflag, int mode) in HalFileOpen() argument 24 return open(path, oflag); in HalFileOpen() 42 int HalFileDelete(const char *path) in HalFileDelete() argument 44 return unlink(path); in HalFileDelete() 47 int HalFileStat(const char *path, unsigned int *fileSize) in HalFileStat() argument 50 int ret = stat(path, &info); in HalFileStat()
|
H A D | hal_file.h | 25 int HalFileOpen(const char* path, int oflag, int mode);
33 int HalFileDelete(const char* path);
35 int HalFileStat(const char* path, unsigned int* fileSize);
|
/commonlibrary/c_utils/base/test/unittest/rust/ |
H A D | rust_utils_directory_test.rs | 94 let path = String::from("/data/"); in test_get_dir_files_001() 96 directory_ex::ffi::RustGetDirFiles(&path, &mut files); in test_get_dir_files_001() 218 let path = "/data/test".to_string(); in test_path_to_real_path_001() 220 let ret = directory_ex::ffi::RustPathToRealPath(&path, &mut realpath); in test_path_to_real_path_001() 222 assert_eq!(path, realpath); in test_path_to_real_path_001() 228 let path = "/data/../data/test".to_string(); in test_path_to_real_path_002() 230 let ret = directory_ex::ffi::RustPathToRealPath(&path, &mut realpath); in test_path_to_real_path_002() 238 let path = "./".to_string(); in test_path_to_real_path_003() 240 let ret = directory_ex::ffi::RustPathToRealPath(&path, &mut realpath); in test_path_to_real_path_003() 248 let path in test_path_to_real_path_004() [all...] |
H A D | rust_utils_file_test.rs | 31 pub fn create_test_file(path: &String, content: &String) -> bool { in create_test_file() 32 if let Ok(mut file) = File::create(path) { in create_test_file() 39 println!("Failed to create file: {}", path); in create_test_file() 44 pub fn remove_test_file(path: &String) -> Result<(), std::io::Error> { in remove_test_file() 45 remove_file(path) in remove_test_file() 195 let path = FILE_PATH.to_string() + ".013"; in test_save_string_to_file_001() 198 create_test_file(&path, &content); in test_save_string_to_file_001() 199 let ret = file_ex::ffi::RustSaveStringToFile(&path, &new_content, true); in test_save_string_to_file_001() 203 assert!(file_ex::ffi::RustLoadStringFromFile(&path, &mut load_result)); in test_save_string_to_file_001() 204 let _err = remove_test_file(&path); in test_save_string_to_file_001() [all...] |
/commonlibrary/rust/ylong_http/ylong_http/src/h2/ |
H A D | pseudo.rs | 25 path: Option<String>, 37 path: None, 46 && self.path.is_none() 93 self.path.is_some() 97 pub fn path(&self) -> Option<&str> { in path() functions 98 self.path.as_deref() in path() 102 pub fn set_path(&mut self, path: Option<String>) { in set_path() 103 self.path = path; in set_path() 108 self.path [all...] |
/commonlibrary/rust/ylong_http/ylong_http/src/h3/ |
H A D | pseudo.rs | 25 path: Option<String>, 36 path: None, 45 && self.path.is_none() 92 self.path.is_some() 96 pub fn path(&self) -> Option<&str> { in path() functions 97 self.path.as_deref() in path() 101 pub fn set_path(&mut self, path: Option<String>) { in set_path() 102 self.path = path; in set_path() 107 self.path [all...] |
/commonlibrary/c_utils/base/test/benchmarktest/file_benchmark_test/ |
H A D | file_benchmark_test.cpp | 62 bool CreateTestFile(const std::string& path, const std::string& content) in CreateTestFile() argument 64 ofstream out(path, ios_base::out | ios_base::trunc); in CreateTestFile() 70 BENCHMARK_LOGD("open file failed! %{public}s", path.c_str()); in CreateTestFile() 74 int RemoveTestFile(const std::string& path) in RemoveTestFile() argument 76 return unlink(path.c_str()); in RemoveTestFile() 341 string path = FILE_PATH; in BENCHMARK_F() local 345 CreateTestFile(path, content); in BENCHMARK_F() 346 bool ret = SaveStringToFile(path, newContent); in BENCHMARK_F() 350 AssertTrue((LoadStringFromFile(path, loadResult)), in BENCHMARK_F() 351 "LoadStringFromFile(path, loadResul in BENCHMARK_F() 365 string path = FILE_PATH; BENCHMARK_F() local 390 string path = FILE_PATH; BENCHMARK_F() local 417 string path = FILE_PATH; BENCHMARK_F() local 443 string path = FILE_PATH; BENCHMARK_F() local 627 string path = FILE_PATH; BENCHMARK_F() local 651 string path = FILE_PATH; BENCHMARK_F() local 677 string path = FILE_PATH; BENCHMARK_F() local [all...] |
/commonlibrary/utils_lite/file/src/file_impl_hal/ |
H A D | file.c | 26 int UtilsFileOpen(const char* path, int oflag, int mode)
in UtilsFileOpen() argument 28 return HalFileOpen(path, oflag, mode);
in UtilsFileOpen() 46 int UtilsFileDelete(const char* path)
in UtilsFileDelete() argument 48 return HalFileDelete(path);
in UtilsFileDelete() 51 int UtilsFileStat(const char* path, unsigned int* fileSize)
in UtilsFileStat() argument 53 return HalFileStat(path, fileSize);
in UtilsFileStat()
|
/commonlibrary/ets_utils/js_util_module/container/ |
H A D | build_ts_js.py | 34 parser.add_argument('--relative-path', 35 help='the code root path relative the root_build_dir') 40 build_path = os.path.abspath(os.path.join(os.getcwd(), input_arguments.relative_path)) 50 filepath = os.path.join(input_arguments.out_filePath, dirname) 52 dstpath = os.path.join(input_arguments.dst_file, filename) 53 srcpath = os.path.join(filepath, filename)
|
/commonlibrary/ets_utils/js_api_module/uri/ |
H A D | js_uri.cpp | 117 pos = data_.find("//"); // userInfo path host port ipv4 or ipv6
in AnalysisUri() 126 uriData_.path = data_;
in AnalysisUri() 158 uriData_.path = data_;
in SpecialPath() 193 uriData_.SchemeSpecificPart.reserve(uriData_.path.length() + uriData_.query.length() + 1);
in AnalysisScheme() 194 uriData_.SchemeSpecificPart.append(uriData_.path);
in AnalysisScheme() 248 // find path
in AnalysisHostAndPath() 282 std::string path = data_.substr(pos);
in AnalysisPath() local 283 if (!CheckCharacter(path, g_rulePath, true)) {
in AnalysisPath() 284 errStr_ = "path does not conform to the rule";
in AnalysisPath() 287 uriData_.path in AnalysisPath() [all...] |
/commonlibrary/rust/ylong_runtime/ylong_io/src/sys/unix/uds/ |
H A D | datagram.rs | 16 use std::path::Path; 28 /// Creates a Unix Datagram Socket bound to the given path. 34 /// if let Ok(socket) = UnixDatagram::bind("/socket/path") { 38 pub fn bind<P: AsRef<Path>>(path: P) -> io::Result<UnixDatagram> { in bind() 39 super::socket::data_gram_bind(path.as_ref()).map(Self::from_std) in bind() 50 /// if let Ok(socket) = UnixDatagram::bind("/path/to/the/socket") { 71 /// Connects the socket to the specified path. 78 /// if let Ok(socket) = socket.connect("/socket/path") { 82 pub fn connect<P: AsRef<Path>>(&self, path: P) -> io::Result<()> { in connect() 83 self.inner.connect(path) in connect() [all...] |
H A D | socket.rs | 17 use std::path::Path; 26 pub(crate) fn bind(path: &Path) -> io::Result<net::UnixListener> { 27 let (socket_addr, addr_length) = socket_addr_trans_un(path)?; 40 pub(crate) fn connect(path: &Path) -> io::Result<net::UnixStream> { 41 let (sockaddr, addr_length) = socket_addr_trans_un(path)?; 58 pub(crate) fn data_gram_bind(path: &Path) -> io::Result<net::UnixDatagram> { 59 let (socket_addr, addr_length) = socket_addr_trans_un(path)?;
|
H A D | socket_addr.rs | 17 use std::path::Path; 21 let path = &sockaddr.sun_path as *const _ as usize; in sun_path_offset() 23 path - base in sun_path_offset() 26 pub(crate) fn socket_addr_trans_un(path: &Path) -> Result<(libc::sockaddr_un, libc::socklen_t)> { 34 let bytes = path.as_os_str().as_bytes(); 41 // Checks path len. 45 "path must be shorter than libc::sockaddr_un.sun_path", 83 let path = unsafe { &*(&self.sockaddr.sun_path as *const [libc::c_char] as *const [u8]) }; 89 let name = &path[1..len]; 99 &path[ [all...] |
/commonlibrary/ets_utils/js_api_module/ |
H A D | build_ts_js.py | 37 PARSER_INST.add_argument('--module-path', 38 help='the module path') 43 PARSER_INST.add_argument('--relative-path', 44 help='the code root path relative the root_build_dir') 47 BUILD_PATH = os.path.abspath(os.path.join(os.getcwd(), INPUT_ARGUMENTS.relative_path)) 52 if not os.path.exists(NODE_PATH): 57 if not os.path.exists(INPUT_ARGUMENTS.out_file):
|
/commonlibrary/ets_utils/js_util_module/ |
H A D | build_ts_js.py | 36 PARSER_INST.add_argument('--module-path', 37 help='the module path') 42 PARSER_INST.add_argument('--relative-path', 43 help='the code root path relative the root_build_dir') 46 BUILD_PATH = os.path.abspath(os.path.join(os.getcwd(), INPUT_ARGUMENTS.relative_path)) 50 if not os.path.exists(NODE_PATH): 55 if not os.path.exists(INPUT_ARGUMENTS.out_file):
|
/commonlibrary/rust/ylong_http/ylong_http_client/src/util/c_openssl/ssl/ |
H A D | ctx.rs | 16 use std::path::Path; 234 let path = match file.as_ref().as_os_str().to_str() { 235 Some(path) => path, 238 match CString::new(path) { 239 Ok(path) => Ok(path),
|