| Author |
Message |
|
|
Post subject: Maximum filename??
Posted: Nov 01, 2007 - 04:46 AM
|
|
Active Member
Joined: Oct 30, 2006
Posts: 16
|
|
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. |
|
|
| |
|
|
|
 |
|
|
Post subject: RE: Maximum filename??
Posted: Nov 01, 2007 - 06:34 AM
|
|
Active Member
Joined: Oct 30, 2006
Posts: 16
|
|
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? |
|
|
| |
|
|
|
 |
|
|
Post subject: Maximum filename length
Posted: Dec 19, 2007 - 12:22 AM
|
|
New Member
Joined: Dec 19, 2007
Posts: 1
|
|
| 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. |
|
|
| |
|
|
|
 |
|
|
Post subject: RE: Maximum filename length
Posted: Dec 19, 2007 - 03:34 AM
|
|
Active Member
Joined: Jan 22, 2003
Posts: 31
Location: Bendigo, Australia
|
|
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 |
|
|
| |
|
|
|
 |
|
|
Post subject: RE: Maximum filename length
Posted: Dec 19, 2007 - 03:58 PM
|
|
QNX Master
Joined: Jul 18, 2002
Posts: 288
|
|
http://www.openqnx.com/index.php?name=FAQ&id_cat=1
Quote:
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.
|
|
|
| |
|
|
|
 |
|
|