回复: [edk2-devel] Why is MAX_LONG_FILE_PATH 500 vs. PATH_MAX?

gaoliming gaoliming at byosoft.com.cn
Fri Oct 30 02:25:25 UTC 2020


Andrew:

 Windows defines _MAX_PATH macro. But, its value is 260. It is not enough. To fix your issue, MAX_LONG_FILE_PATH can be updated as below. 

 

#ifdef PATH_MAX

#define MAX_LONG_FILE_PATH PATH_MAX

#else

#define MAX_LONG_FILE_PATH 500

#endif

 

Thanks

Liming

发件人: bounce+27952+66793+4905953+8761045 at groups.io <bounce+27952+66793+4905953+8761045 at groups.io> 代表 Andrew Fish via groups.io
发送时间: 2020年10月30日 9:37
收件人: gaoliming <gaoliming at byosoft.com.cn>
抄送: devel at edk2.groups.io
主题: Re: [edk2-devel] Why is MAX_LONG_FILE_PATH 500 vs. PATH_MAX?

 

 





On Oct 29, 2020, at 6:34 PM, gaoliming <gaoliming at byosoft.com.cn <mailto:gaoliming at byosoft.com.cn> > wrote:

 

This macro is added to resolve the limitation on WINDOWS OS for the length of entire file path can’t be larger than 255. It use the hard code 500, because 500 is enough for most case. Do you meet with the problem that the file path length exceeds 500?

 

 

Yes locally we have changed it to PATH_MAX to fix a build break we hit. Does Windows support PATH_MAX?

 

Thanks,

 

Andrew Fish





Thanks

Liming

发件人: bounce+27952+66762+4905953+8761045 at groups.io <mailto:bounce+27952+66762+4905953+8761045 at groups.io>  <bounce+27952+66762+4905953+8761045 at groups.io <mailto:bounce+27952+66762+4905953+8761045 at groups.io> > 代表 Andrew Fish via groups.io <http://groups.io> 
发送时间: 2020年10月30日 1:24
收件人: edk2-devel-groups-io <devel at edk2.groups.io <mailto:devel at edk2.groups.io> >
主题: [edk2-devel] Why is MAX_LONG_FILE_PATH 500 vs. PATH_MAX?

 

Does anyone know why MAX_LONG_FILE_PATH [1] is hard coded to 500 vs. using the systems PATH_MAX?

 

On Linux I think PATH_MAX is 4KiB and on macOS it is 1KiB.

 

 

[1] https://github.com/tianocore/edk2/blob/master/BaseTools/Source/C/Common/CommonLib.h#L17

 

Thanks,

 

Andrew Fish

 





-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#66796): https://edk2.groups.io/g/devel/message/66796
Mute This Topic: https://groups.io/mt/77903731/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/edk2-devel-archive/attachments/20201030/abac5e43/attachment.htm>


More information about the edk2-devel-archive mailing list