OpenQNX :: The QNX Community Portal

May 18, 2008 - 12:04 AM
Google
  Web openqnx.com   
     Create an account Home · Submit News · QNX Forums · QNX Download · Search   
_
Main Menu
Who's Online
There are 38 unlogged users and 1 registered user online.

You can log-in or register for a user account here.

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
kasper
Post subject: Maximum filename??  PostPosted: 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.
 
 View user's profile Send private message  
Reply with quote Back to top
kasper
Post subject: RE: Maximum filename??  PostPosted: 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?
 
 View user's profile Send private message  
Reply with quote Back to top
ezsit
Post subject: Maximum filename length  PostPosted: 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.
 
 View user's profile Send private message  
Reply with quote Back to top
ianc
Post subject: RE: Maximum filename length  PostPosted: 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
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
xtang
Post subject: RE: Maximum filename length  PostPosted: 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.
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2007 The PNphpBB Group
Credits
All logos and trademarks in this site are property of their respective owners. The comments are property of their posters.
Powered by OpenQNX: The QNX Community Portal Site
QNX and the QNX logo are registered trademarks of QNX Software Systems.