Java MAX_PATH 等效吗?
Java 中是否有相当于 C 的 MAX_PATH 常量?一直在网上寻找答案,但找不到。谢谢
Is there an equivalent of C's MAX_PATH constant in Java? Been troving the web for an answer and can't find one. Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,没有等效的东西(尤其对于小程序来说)。除非你想做JNI,否则你无法获取该信息。您可能达到的唯一限制是
String
最大长度限制(无论如何,这远远超出了任何操作系统所允许的长度)。我假设要么会抛出异常,要么文件名(或路径)将被截断。这是一个相关问题:Does Java IO has a max file name length ?
No, there's no equivalent (especially for an applet). Unless you want to do JNI, you can't get that information. The only limit you may reach is the
String
max length limit (which is far beyond what any operating system would allow, anyway).I assume either an exception would be thrown or the filename (or path) will be truncated. Here's a related question: Does Java IO have a maximum file name length?