kasper
November 1, 2007, 4:46am
1
I knew that qnx is supported to 255 filename.
so i coded “test.c” at /hdd1.
mounted /dev/hd1 /hdd1
source is…
#include <string.h>
#include <stdio.h>
#include <errno.h>
int main()
{
FILE *fp;
fp = fopen("123456789012345678901234567890123456789012345678901234567890.txt", "wb");
if(!fp) printf("%s\n", strerror(errno));
return 0;
}
and compile, execute test program.
#make test
#./test
then printed that “Filename too long”.
so… i tried to “dinit -h /dev/hd1”
and retried to “mount /dev/hd1 /hdd1”
and again compile, execute test program.
#make test
#./test
then created file “1234567890…txt”
what is this?
so i reboot and retried…
then printed that “Filename too long”.
wow… qnx was kidding me?? T.T
I want to create long filename.
so… what can i do?? please help.
Best Regards.
kasper
November 1, 2007, 6:34am
2
Oh!! I got it!!
The reason is… authority of /hdd1.
#chmod 777 /hdd1
If hdd1 got authority(777), can’t create long filename.
I don’t know exactly why…
Anyone know that?
ezsit
December 19, 2007, 12:22am
3
I thought that the QNX4 filesystem was limited to 31 characters, or was it 40 something characters? QNX 6.3.2 still uses the QNX4 filesystem I believe.
ianc
December 19, 2007, 3:34am
4
from limits.h
PATH_MAX 255
NAME_MAX 48
hence path name can be 255 characters
base file name can only be 48 characters
hence fp = fopen(“123456789012345678901234567890123456789012345678901234567890.txt”, “wb”); is not possible
the b in “wb” is redundant. No such thing as text and binary files in QNX
xtang
December 19, 2007, 3:58pm
5
openqnx.com/index.php?name=FAQ&id_cat=1
Does QNX support long filenames?
With the release of QNX 6.2.1, QNX breaks the old 48 characters limit in filenames.
To active the long filename support for a particular QNX partition, you need to
touch /mnt/point/.longfilenames
chmod 444 /mnt/point/.longfilenames
chown root:root /mnt/point/.longfilenames
If you only have one QNX partition, which is mounted as /, you can just
touch /.longfilenames
chmod 444 /.longfilenames
chown root:root /.longfilenames
You will need to umount and mount the partition again before it can take effect. It usually means a reboot, especially if you are working on the root partition.
If you create a new QNX partition, you can use the -N option with dinit, and this will create the new QNX filesystem with the long filename support.