几个关于文件路径方面的函数,不断更新...

Logstash配置详解(不断更新) 1. Input Plugin 1.1 从文件输入 从文件读取数据,如常见的日志文件。文件读取通常要解决几个问题: No. 问题 解决办法 1 文件内容如何只被读取一次?即重启Logstash时,从上次读取的位置继续 sincedb 2 如何即时读取到文件的新内容 定时检查文件是否有更新 3 如何发现新文件并进行读取 定时检查是否有新文件生成 4 如何文件发生了归档(r... 阅读详情

PathStripToRoot      得到该路径的根目录

 

Removes all parts of the path except for the root information.

Syntax

BOOL PathStripToRoot(      

    LPTSTR szRoot


);

Parameters

szRoot
[in, out] A pointer to a null-terminated string of maximum length MAX_PATH that contains the path to be converted.

Return Value

Returns TRUE if a valid drive letter was found in the path, or FALSE otherwise.

 

 

 

PathIsDirectory              查看路径是否是一个合法的文件夹

Verifies that a path is a valid directory.

Syntax

BOOL PathIsDirectory(      
    LPCTSTR pszPath
);

Parameters

pszPath
[in] A pointer to a null-terminated string of maximum length MAX_PATH that contains the path to verify.

Return Value

Returns TRUE if the path is a valid directory, or FALSE otherwise.

 

 

GetDiskFreeSpaceEx Function  得到某个盘的使用未使用容量

 

Retrieves information about the amount of space that is available on a disk volume, which is the total amount of space, the total amount of free space, and the total amount of free space available to the user that is associated with the calling thread.

BOOL WINAPI GetDiskFreeSpaceEx(
__in LPCTSTR lpDirectoryName ,
__out PULARGE_INTEGER lpFreeBytesAvailable ,
__out PULARGE_INTEGER lpTotalNumberOfBytes ,
__out PULARGE_INTEGER lpTotalNumberOfFreeBytes
);
Parameters
lpDirectoryName

A directory on the disk.

If this parameter is NULL, the function uses the root of the current disk.

If this parameter is a UNC name, it must include a trailing backslash, for example, //MyServer/MyShare/.

This parameter does not have to specify the root directory on a disk. The function accepts any directory on a disk.

The calling application must have FILE_LIST_DIRECTORY access rights for this directory.

lpFreeBytesAvailable

A pointer to a variable that receives the total number of free bytes on a disk that are available to the user who is associated with the calling thread.

This parameter can be NULL.

If per-user quotas are being used, this value may be less than the total number of free bytes on a disk.

lpTotalNumberOfBytes

A pointer to a variable that receives the total number of bytes on a disk that are available to the user who is associated with the calling thread.

This parameter can be NULL.

If per-user quotas are being used, this value may be less than the total number of bytes on a disk.

To determine the total number of bytes on a disk or volume, use IOCTL_DISK_GET_LENGTH_INFO .

lpTotalNumberOfFreeBytes

A pointer to a variable that receives the total number of free bytes on a disk.

This parameter can be NULL.

Return Value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero (0). To get extended error information, call GetLastError .

Remarks

The values obtained by this function are of the type ULARGE_INTEGER . Do not truncate these values to 32 bits.

The GetDiskFreeSpaceEx function returns zero (0) for lpTotalNumberOfFreeBytes and lpFreeBytesAvailable for all CD requests unless the disk is an unwritten CD in a CD-RW drive.

Symbolic link behavior—If the path points to a symbolic link, the operation is performed on the target.

 

 

GetDriveType Function 得到盘的类型

 

Determines whether a disk drive is a removable, fixed, CD-ROM, RAM disk, or network drive.

To determine whether a drive is a USB-type drive, call SetupDiGetDeviceRegistryProperty and specify the SPDRP_REMOVAL_POLICY property.

UINT WINAPI GetDriveType(
__in LPCTSTR lpRootPathName
);
Parameters
lpRootPathName

The root directory for the drive.

A trailing backslash is required. If this parameter is NULL, the function uses the root of the current directory.

Return Value

The return value specifies the type of drive, which can be one of the following values.

 

 

 

 

PathAddBackslash Function


Adds a backslash to the end of a string to create the correct syntax for a path. If the source path already has a trailing backslash, no backslash will be added.

Syntax

LPTSTR PathAddBackslash(      
    LPTSTR lpszPath
);

Parameters

lpszPath
[in, out] A pointer to a buffer with a string that represents a path. The size of this buffer should be set to MAX_PATH to ensure that it is large enough to hold the returned string.

Return Value

Returns the address of the NULL that terminates the string. If the backslash could not be appended due to inadequate buffer size, returns NULL.

 

PathAddExtension Function


Adds a file extension to a path string.

Syntax

BOOL PathAddExtension(      
    LPTSTR pszPath ,
    LPCTSTR pszExtension
);

Parameters

pszPath
[in, out] A pointer to a buffer with the null-terminated string to which the file extension will be appended. You should set the size of this buffer to MAX_PATH to ensure that it is large enough to hold the returned string.
pszExtension
[in] A pointer to a null-terminated string that contains the file extension.

Return Value

Returns TRUE if an extension was added, or FALSE otherwise.

PathFileExists Function


Determines whether a path to a file system object such as a file or directory is valid.

Syntax

BOOL PathFileExists(      
    LPCTSTR pszPath
);

Parameters

pszPath
[in] A pointer to a null-terminated string of maximum length MAX_PATH that contains the full path of the object to verify.

Return Value

Returns TRUE if the file exists, or FALSE otherwise. Call GetLastError for extended error information.

Remarks

This function tests the validity of the path.

A path specified by Universal Naming Convention (UNC) is limited to a file only; that is, //server/share/file is permitted. A UNC path to a server or server share is not permitted; that is, //server or //server /share . This function returns FALSE if a mounted remote drive is out of service.

 

PathIsDirectoryEmpty Function


Determines whether a specified path is an empty directory.

Syntax

BOOL PathIsDirectoryEmpty(      
    LPCTSTR pszPath
);

Parameters

pszPath
[in] A pointer to a null-terminated string of maximum length MAX_PATH that contains the path to be tested.

Return Value

Returns TRUE if pszPath is an empty directory. Returns FALSE if pszPath is not a directory, or if it contains at least one file other than "." or "..".

Remarks

"C:/" is considered a directory.

 

PathIsPrefix Function


Searches a path to determine if it contains a valid prefix of the type passed by pszPrefix . A prefix is one of these types: "C://", ".", "..", "..//".

Syntax

BOOL PathIsPrefix(      
    IN LPCTSTR pszPrefix ,
    IN LPCTSTR pszPath
);

Parameters

pszPrefix
[in] A pointer to a null-terminated string of maximum length MAX_PATH that contains the prefix for which to search.
pszPath
[in] A pointer to a null-terminated string of maximum length MAX_PATH that contains the path to be searched.

Return Value

Returns TRUE if the compared path is the full prefix for the path, or FALSE otherwise.

 

PathIsRoot Function


Parses a path to determine if it is a directory root.

Syntax

BOOL PathIsRoot(      
    LPCTSTR pPath
);

Parameters

pPath
[in] A pointer to a null-terminated string of maximum length MAX_PATH that contains the path to be validated.

Return Value

Returns TRUE if the specified path is a root, or FALSE otherwise.

Remarks

Returns TRUE for paths such as "/", " X :/", "// server / share ", or "// server /". Paths such as "../path2" will return FALSE.

 

PathIsSameRoot Function


Compares two paths to determine if they have a common root component.

Syntax

BOOL PathIsSameRoot(      
    LPCTSTR pszPath1 ,
    LPCTSTR pszPath2
);

Parameters

pszPath1
[in] A pointer to a null-terminated string of maximum length MAX_PATH that contains the first path to be compared.
pszPath2
[in] A pointer to a null-terminated string of maximum length MAX_PATH that contains the second path to be compared.

Return Value

Returns TRUE if both strings have the same root component, or FALSE otherwise.

 

PathIsNetworkPath Function


Determines whether a path string represents a network resource.

Syntax

BOOL PathIsNetworkPath(      
    LPCTSTR pszPath
);

Parameters

pszPath
[in] A pointer to a null-terminated string of maximum length MAX_PATH that contains the path.

Return Value

Returns TRUE if the string represents a network resource, or FALSE otherwise.

Remarks

PathIsNetworkPath interprets the following two types of paths as network paths.

 

  • Paths that begin with two backslash characters (//) are interpreted as Universal Naming Convention (UNC) paths.
  • Paths that begin with a letter followed by a colon (:) are interpreted as a mounted network drive. However, PathIsNetworkPath cannot recognize a network drive mapped to a drive letter through the Microsoft MS-DOS SUBST command or the DefineDosDevice function.
Note   The function does not verify that the specified network resource exists, is currently accessible, or that the user has sufficient permissions to access it.

 

PathIsURL Function


Tests a given string to determine if it conforms to a valid URL format.

Syntax

BOOL PathIsURL(      
    LPCTSTR pszPath
);

Parameters

pszPath
[in] A pointer to a null-terminated string of maximum length MAX_PATH that contains the URL path to validate.

Return Value

Returns TRUE if pszPath has a valid URL format, or FALSE otherwise.

Remarks

This function does not verify that the path points to an existing site—only that it has a valid URL format.

 

 

 

 

PathSkipRoot Function


Parses a path, ignoring the drive letter or Universal Naming Convention (UNC) server/share path parts.

Syntax

LPCTSTR PathSkipRoot(      
    LPCTSTR pszPath
);

Parameters

pszPath
[in] A pointer to a null-terminated string of maximum length MAX_PATH that contains the path to parse.

Return Value

Returns the address of the beginning of the subpath that follows the root (drive letter or UNC server/share).

PathStripPath Function


Removes the path portion of a fully qualified path and file.

Syntax

void PathStripPath(      
    LPTSTR pszPath
);

Parameters

pszPath
[in, out] A pointer to a null-terminated string of maximum length MAX_PATH that contains the path and file name that will have the path portion removed.

Return Value

No return value.

PathMakeSystemFolder Function


Gives an existing folder the proper attributes to become a system folder.

Syntax

BOOL PathMakeSystemFolder(      
    LPTSTR pszPath
);

Parameters

pszPath
[in] A pointer to a null-terminated string of maximum length MAX_PATH that contains the name of an existing folder that will be made into a system folder.

Return Value

Returns nonzero if successful, or zero otherwise.

 

PathUnmakeSystemFolder Function


Removes the attributes from a folder that make it a system folder. This folder must actually exist in the file system.

Syntax

BOOL PathUnmakeSystemFolder(      
    LPTSTR pszPath
);

Parameters

pszPath
[in] A pointer to a null-terminated string of maximum length MAX_PATH that contains the name of an existing folder that will have the system folder attributes removed.

Return Value

Returns nonzero if successful, or zero otherwise.

 

PathIsSystemFolder Function


Determines if an existing folder contains the attributes that make it a system folder. Alternately, this function indicates if certain attributes qualify a folder to be a system folder.

Syntax

BOOL PathIsSystemFolder(      
    LPCTSTR pszPath ,
    DWORD dwAttrb
);

Parameters

pszPath
[in] A pointer to a null-terminated string of maximum length MAX_PATH that contains the name of an existing folder. The attributes for this folder will be retrieved and compared with those that define a system folder. If this folder contains the attributes to make it a system folder, the function returns nonzero. If this value is NULL, this function determines if the attributes passed in dwAttrb qualify it to be a system folder.
dwAttrb
[in] The file attributes to be compared. If pszPath is not NULL, this value is ignored. If pszPath is NULL, the attributes passed in this value are compared with those that qualify a folder as a system folder. If the attributes are sufficient to make this a system folder, this function returns nonzero. These attributes are the attributes that are returned from GetFileAttributes.

Return Value

Returns nonzero if the pszPath or dwAttrb represent a system folder, or zero otherwise.

 

 

暂时就写这么多吧。大家可以在  shlwapi.h 这个文件里面找到大部分的函数。  如果以后还有会加的。

 

 

 

 

 

 

 

 


MMSegmentation遇到的问题汇总(不断更新) 首先说明一下我的运行环境是在win10下的 遇到的第一个问题就是在训练的时候不知道在哪里能运行模型,后来参考mmsegmentation文档才明白该在哪里进行train,具体的train文件是在tools下面的train文件 为了方便起见我并没有在命令行配置参数,而是直接修改train文件 config我默认的default是我自己根据数据集对原模型进行修改而得到的,当然也可以直接用config里面的模型文件,workdir是输出的log文件路径 同时数据集文件里面我用的直接路径,并 阅读详情

相关推荐

rk3568系统buildroot开发笔记-不断更新

构建RK3568系统期间遇到的各种问题,我主要分为编译问题和运行问题

Reasonss的博客 3849

Windows路径操作API函数学习

前言   在VC++开发过程中,经常需要用到一些路径操作,比如拼需要的文件路径,搜索路径中的内容等等。Windows提供了一套关于路径操作的API帮助我们更好的执行这些操作。 路径截断与合并API PathRemoveArgs       去除路径后面的参数 PathRemoveBackslash*    去除路径最后的反斜杠“\” PathAddBackslash*      在路...

weixin_30621711的博客 267

Win10+Anaconda环境下PaddleOCR保姆级安装指南(附常见报错解决方案)

本文提供Win10+Anaconda环境下PaddleOCR的保姆级安装指南,涵盖从环境配置到模型部署的全流程,特别针对常见报错提供解决方案。通过详细的步骤说明和实用技巧,帮助开发者快速完成PaddleOCR安装与测试,避免常见陷阱,提升OCR开发效率。

weixin_29096377的博客 375

文件夹创建删除和判断

2. C++ 判断文件/文件夹 是否存在 [cpp] view plaincopy #include    string strFileName = "filePath";      if (PathIsDirectory(strFileName))   {       //判断文件夹是否存在   }      if (PathFileE

u012023801的专栏 557

爬虫小例--爬药监局(上)

”明月如霜,好风如水,清景无限 “ 文远最近也算是爬虫入门吧,相信后面会慢慢熟悉。 壹 直接上例子,爬取药监局的数据。目的是得到每家公司的详情数据,例: 具体网址:http://scxk.nmpa.gov.cn:81/xk/ 这是主页,下面详情信息: 贰 分析,通过网页检查发现,主网页上没有公司相关数据,观察XHR中的Ajax请求发现,公司信息都是动态数据(方便更新),点击发现每个公司 的详情信息通过ID号这个参数区别,那么可以确定思路是先得到每个公司的ID号,然后在通过ID对应每一个详细网站,同样右键

john_ashley的博客 4556

Zabbix 简介、优缺点、基础原理

(8条消息) Zabbix 的基础概念、原理和架构_Lee木木的博客-优快云博客_zabbix架构类型Zabbix 的基础概念、原理和架构_Lee木木的博客-优快云博客_zabbix架构类型 --------------------------------------------------------------------------------------------------------------------------- 一、Zabbix 简介 Zabbix是由A...

weixin_50196615的博客 2037

Windows API关于文件路径的处理函数

C/C++ Windows API一些与路径相关的函数使用说明

zhuimengshizhe87的专栏 964

glm-4v-9b环境配置全攻略:从CUDA版本冲突到bitsandbytes异常排查(RTX A4000实测)

本文详细介绍了在RTX A4000显卡上配置GLM-4V-9B多模态大模型的完整流程,重点解决CUDA版本冲突和bitsandbytes异常问题。通过4-bit量化技术显著降低显存占用,提供从环境预检到量化部署的实战指南,帮助开发者在有限显存环境下高效运行大模型。

weixin_30369041的博客 405

路径相关的函数

需要头文件:shlwapi.h其中有一些函数功能存在重复,我在认为比较常用的的函数上加红。BOOL PathFileExists(LPCTSTR lpszPath)功能:检查文件/路径是否存在LPTSTR PathFindFileName(LPCTSTR pPath)功能:获得路径中的文件名例如: PathFileFileName( “c:\\Program Files\\File.txt” ) ...

weixin_34082854的博客 306

嵌入式面经(2)——央企篇

前文得知我只投央企,不投国企,有面试的央企大致有三类:感兴趣的同学可以和我私聊军工央企相关(航空航天,兵器兵工)制造央企相关(三桶油,装备制造)金融运维相关(信通集团,国有银行)接下来我将对我有的面试中询问的面经进行总结。

coldmood77的博客 466

基于STM32的DS1302电子时钟电路与程序设计

这个示例代码中,我们使用DS1302_GetTime函数从DS1302芯片获取当前时间,并使用DS1302_GetDate函数获取当前日期。在本文中,我们将介绍如何使用STM32微控制器和DS1302实时时钟芯片来构建一个基于STM32的DS1302电子时钟,并提供相应的程序设计。请注意,以上示例代码仅供参考,具体的实现细节可能会根据使用的开发环境和硬件组件有所差异。在实际应用中,你可能需要根据自己的需求进行适当的调整和修改。为了完整实现电子时钟的功能,你还可以添加其他功能,例如闹钟设置、温度显示等。

UbiSqlserver的博客 1324

学习记录,不断更新

将 printk("yangchaofeng testing : %s->%s:%i\n", __FILE__,__FUNCTION__, __LINE__);

yangchaofeng001的专栏 668

Ollama系列---【ollama使用gpu运行大模型】

一、安装CudaToolkit 使用控制台命令查看当前显卡驱动中的cuda版本 nvidia-smi 二、下载CudaToolkit 注意:CudaToolkit版本要低于上面的显卡Cuda版本。 Cuda各版本下载地址:https://developer.nvidia.com/cuda-toolkit-archive 下载好之后,一路下一步,一直默认即可。 如果安装到了自定义的位置,记得加环...

-少年-的博客 7982

【python】os常用锦集(不断更新)

【python】os常用锦集(不断更新) 这也是本人在遇到困难后查找并整理到这上面来,希望能够帮到你,有不对的地方以及好的建议欢迎指出,以及你认为该库还有哪些常用的函数可以在评论区打出,功能或返回值+参一内容+参二内容,让我们一起帮助遇到相应困难的猿! 返回(文件路径,文件名)参一:文件路径 [-1]元组最后一个值即文件名 os.path.split(filepath)[-1] os.path....

文始道宗藏经阁 149

使用timeROC包的compare函数比较不同标记物下两个多时间AUC值是否具有统计显著性

时间依赖的接收器操作特征曲线(time-dependent receiver operating characteristic curve, time-dependent ROC curve)是评估和比较标记物在不同时间点上预测能力的重要工具。在R语言中,timeROC包提供了丰富的函数和工具,可用于分析和比较多时间点的AUC值。时间点(timepoints)表示观察的时间点,标记物1(marker1)和标记物2(marker2)分别表示在每个时间点上的预测概率。最后,我们输出比较结果。

2301_79331387的博客 921

汉书HE8,好用的汇编代码编写工具

汉书HE8,好用的汇编代码编写工具早期编写汇编代码所用功能强大

常用但又易遗忘的语句(不断更新)

dirname -- 返回路径中的目录部分$path = "/etc/passwd";$file = dirname ($path); // $file is set to "/etc"?> -----------------------------------------basename -- 返回路径中的文件名部分$path = "/home/httpd/html/index.php";$

.Kaway.Cheng专栏 1305

假人有限元模型

假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用

[IOS]iphone开发之常用代码:不断更新

1,获取翻转事件,并开启翻转: 只要在viewcontroller的类中加入 -(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation{//翻转后要执行的代码return YES;} 2,-(void)viewWillAppear:(BO...

abv10122的博客 392

华为的C语言编程规范.pdf

华为技术有限公司内部技术规范。本规范制定了编写C语言程序的基本原则、规则和建议。从代码的清晰、简洁、可测试、安全、程序效率、可移植各个方面对C语言编程作出了具体指导。

温度PID控制PLC程序

温度PID稳定控制程序,适用于欧姆龙PLC,对其他PLC也具有很大参考价值

杂记_一些关于python代码风格汇总_不断更新

1、每个函数之间至少空一行, 每个类之间至少空两行

L聪记博客 462

Python技巧 ---- 不断更新中

1. 读取文件的内容filePath = "文件路径"(lambda f: (f.read(), f.close()))(file(filePath))[0] 2. 将内容写入到文件中(lambda f, d: (f.write(d), f.close()))(file(rd:/a.txt, w), 要写入的数据) 3. 根据正则表达式过滤文件夹中的文件

2827

Mac下Idea快捷键总结(不断更新)

command+,preferences设置 command+; project Structure设置 command+n 生成get set toString方法 command+delete 删除一整行 command+d 复制当前代码到下一行 shift+command+上下箭头 移动代码 option+command+t 调出try catch option+回车 自动导入import class option+command+L 格式化代码 ...........................

weixin_58642210的博客 2万+

javafx遭遇的问题记录集合,不断更新。。。。。。。

有些问题很傻,但是我们总是犯,有些问题hen

小小懒羊羊 3917

iphone开发之常用代码:不断更新

1,获取翻转事件,并开启翻转: 只要在viewcontroller的类中加入   -(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation{//翻转后要执行的代码return YES;} 2,-(void)vie

1497

c语言学习(三)snprintf函数修改路径

文章目录1 代码2 结果3 知识点总结 1 代码 #include <stdio.h> int main() { int i = 0; char FileName[128]; for (i = 0; i < 10; i++) { snprintf((char*)FileName, 128, "C:/Users/Administrator/Desktop/txt/%d.txt", i); printf("FileName is %s\n", FileName); }

YL950305的博客 436

正则表达式应用范例合集(不断更新)

1、以某文件路径开头,以plist文件结尾。^(D:\\dev\\cocos2d-x-3.9\\projects\\TextureUnpack\\Resources\\KD_Resources\\).*(plist)$说明:^代表开头, $代表结尾, .代表任意字符,*代表多个

u012839224的专栏 724

安卓开发中所遇到的一些问题及解决办法,不断更新中

Installation error: INSTALL_FAILED_INSUFFICIENT_STORAGE[字面意思:安装失败,不够贮存]

2370
上一篇: cin EOF Linux
下一篇: ACE调试信息的输出
HelloDan
博客等级 码龄20年 187粉丝 27原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值