[OT]Linux下Path环境变量有长度限制么?

570 views
Skip to first unread message

赵锦威

unread,
Nov 29, 2014, 4:41:06 AM11/29/14
to sh...@googlegroups.com

问这个问题是因为今天在Windows下发现Win下的Path环境变量居然是有长度限制的。。。所以就想来请教一下Linux下对Path有没有限制。。。

再OT一下,假设我现在Win下现有的Path是一个长度为n的字符串,现在要安装一个新的软件,该软件需要添加的Path环境变量的长度为m。假如m+n超过了Windows的限制,会发生什么情况?会不会把原来长度为n的Path全部替换为m。。。

(问这个是因为今天装CTeX的时候,装完之后发现Path全部变成CTeX的环境变量了。。。安装前我备份过Path,然后我把备份前的Path加上CTeX新注册的Path,发现超过Windows的限制了。。。CTeX的官网自己也说有时候会发生Path丢失的问题。。。所以我开了个脑洞想会不会就是因为超限了呢?)

liyaoshi

unread,
Dec 9, 2014, 10:07:51 PM12/9/14
to sh...@googlegroups.com
windows 目录长度是256字节

--
-- You received this message because you are subscribed to the Google Groups Shanghai Linux User Group group. To post to this group, send email to sh...@googlegroups.com. To unsubscribe from this group, send email to shlug+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/shlug?hl=zh-CN
---
您收到此邮件是因为您订阅了Google网上论坛上的“Shanghai Linux User Group”群组。
要退订此群组并停止接收此群组的电子邮件,请发送电子邮件到shlug+un...@googlegroups.com
要查看更多选项,请访问https://groups.google.com/d/optout

Liu Cheng

unread,
Dec 10, 2014, 2:36:47 AM12/10/14
to sh...@googlegroups.com
这个不是在说目录长度啊- - 印象中Windows的API目录长度限制应该是260,不过查了一下发现可以通过一些方法绕开- -
但环境变量还真不清楚,刚查了一下32767- - 不知道怎么能写出3w多的PATH......

Yongwei Wu

unread,
Dec 10, 2014, 10:51:36 PM12/10/14
to sh...@googlegroups.com
要超也真是累人的事。这两个链接应该有帮助:

http://stackoverflow.com/questions/1078031/what-is-the-maximum-size-of-an-environment-variable-value
http://blogs.msdn.com/b/oldnewthing/archive/2010/02/03/9957320.aspx
> --
> -- You received this message because you are subscribed to the Google Groups
> Shanghai Linux User Group group. To post to this group, send email to
> sh...@googlegroups.com. To unsubscribe from this group, send email to
> shlug+un...@googlegroups.com. For more options, visit this group at
> https://groups.google.com/d/forum/shlug?hl=zh-CN
> ---
> 您收到此邮件是因为您订阅了Google网上论坛上的“Shanghai Linux User Group”群组。
> 要退订此群组并停止接收此群组的电子邮件,请发送电子邮件到shlug+un...@googlegroups.com
> 要查看更多选项,请访问https://groups.google.com/d/optout



--
Wu Yongwei
URL: http://wyw.dcweb.cn/

赵锦威

unread,
Dec 11, 2014, 12:02:06 AM12/11/14
to sh...@googlegroups.com
涨知识了,感谢!

在 2014年12月11日星期四UTC+8上午11时51分36秒,吴咏炜写道:
> 要退订此群组并停止接收此群组的电子邮件,请发送电子邮件到shlug+unsubscribe@googlegroups.com
Reply all
Reply to author
Forward
0 new messages