如何配置Linux Ubuntu可以处理的文件名长度?
我在 tomcat 和 Linux Ubuntu 上使用 Liferay 门户服务器。
Liferay 正在生成一个非常长的文件。 我已经在 Windows 中看到了这些文件及其工作原理。 但是当我尝试在 ubuntu 中运行它时,它不会创建该文件,并且我的服务器给我错误。 我还尝试过创建一个文件名很长的文件,但它确实不允许我这样做。
Linux Ubuntu 有办法让我这样做吗?
Im using Liferay portal server on tomcat and Linux Ubuntu.
Liferay is generating a file that is very long. I've seen those files in windows and its working. But when i tried running it in ubuntu, it doesn't create the file and my server is giving me error. I've also tried to make a file with a very long filename and it really doesn't allow me.
Is there a way for Linux Ubuntu to allow me to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
解决这个问题...
我的问题的根源是我的 ubuntu 操作系统的加密主页。 似乎创建的文件的文件名也被加密,使我的长文件名变得更长。
当我重新安装我的 Ubuntu 时,我不再加密我的家,它现在工作正常......非常感谢大家......
Fix this...
The source of my problem is the encrypted home of my ubuntu OS. It seems that the filename of the file created is also encrypted making my long filename even longer.
When i made a new installation of my Ubuntu, i didn't encrypt my home anymore and it works fine now.. thanks a lot all...
我在 Ubuntu 9.10 机器上遇到了同样的问题,我认为这确实是由主目录加密引起的。 这些“太长”的文件名在我家外面工作得很好。
I had the same problem on my Ubuntu 9.10 machine and I think it really was caused by the home-directory encryption. Those "too long" filenames work fine outside my home.
它可能无法工作的原因有很多,其中最重要的可能是文件名太长(除非我们谈论的文件名超过 255 个字符,我认为这是硬限制)。
另外,文件长度不会成为一个大问题,除非你有一些真正巨大的文件(有时linux文件系统上限为2GB,但我不知道如果你超过了会是什么行为。你可能仍然会看到一个 2GB 的文件,其中不包含所有内容)。
我的本能反应是说您遇到了权限问题,服务器运行的用户(例如“www”或“www-data”或其他)没有在文件夹中写入的权限它也在尝试。
There's a huge slew of reasons it may not be working, probably the least of which is a long file name (unless we're talking about a filename over 255 characters, which I believe is the hard-limit).
Also, file length isn't going to be a big problem unless you've got some truly enormous files (sometimes linux filesystems cap at 2GB, but I don't know what the behaviour is if you went over. You'd probably still see a 2GB file that just doesn't contain everything).
My knee-jerk reaction would be to say you're having a permissions problem where the user the server is running as (say, 'www' or 'www-data', or whatever) doesn't have permission to write in the folder its trying too.
您作为示例给出的文件名很好:
我想问题是您将该文件名传递给未转义的 shell,并且它正在解释 & 特点。 将文件名放在单引号中,就像我在示例中一样。
The filename you have given as an example is fine:
I imagine the problem is that you are passing that filename to a shell un-escaped, and it is interpreting the & character. Put the filename in single-quotes, as I have in my example.