Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - devb-ram disk, trouble with long filenames: (7 Items)
   
devb-ram disk, trouble with long filenames  
Hi.

I have an application that is storing ~200 files that have fairly long filenames. This works most of the time, but when 
the file names get long enough, I seem to get scrambled filenames. My application tries to store e.g. 
/tmp/File-1234567890123456789012345678901234567890_052.bin
but the file
/tmp/File-123456789012345678901234567890123~00000159.bin

is created on disk. This seems to happen quite randomly, i.e. 8 of 200 files get a wrong filename, and it is not the 
same ones from run to run. The data inside the files are OK, but the scrambled filenames messes up some of my downstream
 processing.

It seems like I do not get this error if I make sure the filenames are not larger than 47 characters, so I have a 
workaround. 

But I thought I would post it to see if anyone else has seen this, and/or know other, better ways to work around it or 
fix it.

Best regards,
Martin

P.S.: Some info about my setup:
I am using a ram disk created with devb-ram, but to avoid caching I am actually using the piggybacked ramdisk that is 
created when I do:

devb-ram cam quiet blk cache=0,ramdisk=15m ram capacity=28 nodinit disk name=dummydisk

I then get
/dev/dummydisk and /dev/ram0, where ram0 is the 15meg disk that I use

I do the following to mount the disk as /tmp
dinit -hq /dev/ram0
mount /dev/ram0 /tmp

I found that this disk is faster than anything devb-ram can make, some kind soul here on this forums told me that was 
because devb-ram implements a cache that is not really necessary when you are working with a ram-backed disk.

I am on QNX 6.3.2
    
RE: devb-ram disk, trouble with long filenames  
By default QNX4 filesystem is limited to 48 char. To use long filename the filesystem must have a filename called .
longfilename ( check for exact name i`m not sure). The existence of that file will enable the feature.

-----Message d'origine-----
De : Odd Martin Staal [mailto:community-noreply@qnx.com] 
Envoyé : 2 juillet 2010 11:16
À : momentics-community
Objet : devb-ram disk, trouble with long filenames

Hi.

I have an application that is storing ~200 files that have fairly long filenames. This works most of the time, but when 
the file names get long enough, I seem to get scrambled filenames. My application tries to store e.g. 
/tmp/File-1234567890123456789012345678901234567890_052.bin
but the file
/tmp/File-123456789012345678901234567890123~00000159.bin

is created on disk. This seems to happen quite randomly, i.e. 8 of 200 files get a wrong filename, and it is not the 
same ones from run to run. The data inside the files are OK, but the scrambled filenames messes up some of my downstream
 processing.

It seems like I do not get this error if I make sure the filenames are not larger than 47 characters, so I have a 
workaround. 

But I thought I would post it to see if anyone else has seen this, and/or know other, better ways to work around it or 
fix it.

Best regards,
Martin

P.S.: Some info about my setup:
I am using a ram disk created with devb-ram, but to avoid caching I am actually using the piggybacked ramdisk that is 
created when I do:

devb-ram cam quiet blk cache=0,ramdisk=15m ram capacity=28 nodinit disk name=dummydisk

I then get
/dev/dummydisk and /dev/ram0, where ram0 is the 15meg disk that I use

I do the following to mount the disk as /tmp
dinit -hq /dev/ram0
mount /dev/ram0 /tmp

I found that this disk is faster than anything devb-ram can make, some kind soul here on this forums told me that was 
because devb-ram implements a cache that is not really necessary when you are working with a ram-backed disk.

I am on QNX 6.3.2
    



_______________________________________________

QNX Momentics Community Support
http://community.qnx.com/sf/go/post58336

RE: devb-ram disk, trouble with long filenames  
It's actually .longfilenames (with an "s"). You can find out more about
it here in Neutrino User's Guide:

 
http://www.qnx.com/developers/docs/6.4.1/neutrino/user_guide/fsystems.ht
ml#QNX4_filenames


Steve Reid (stever@qnx.com)
Technical Editor
QNX Software Systems 
 

> -----Original Message-----
> From: Mario Charest [mailto:community-noreply@qnx.com] 
> Sent: Monday, July 05, 2010 7:31 PM
> To: momentics-community
> Subject: RE: devb-ram disk, trouble with long filenames
> 
> By default QNX4 filesystem is limited to 48 char. To use long 
> filename the filesystem must have a filename called 
> .longfilename ( check for exact name i`m not sure). The 
> existence of that file will enable the feature.
Re: RE: devb-ram disk, trouble with long filenames  
Hi guys. Thanks for the answers. However, long file names should be enabled by default, if i read the page linked to by 
the previous post correctly. I checked my /tmp disk and it does contain the .longfilenames file.

Any other ideas what might go wrong here?

Martin
RE: RE: devb-ram disk, trouble with long filenames  
Are you sure /tmp is a mount point, make sure there isn't a directory also call /tmp on your hard disk.

Have you tried manually creating a directory/file such as "touch blablalbalallaladlfladflasdflaldsflasf" to make sure 
it's not an issue with your program.

What if you do it to a real HD does it work?

-----Message d'origine-----
De : Odd Martin Staal [mailto:community-noreply@qnx.com] 
Envoyé : 7 juillet 2010 03:31
À : momentics-community
Objet : Re: RE: devb-ram disk, trouble with long filenames

Hi guys. Thanks for the answers. However, long file names should be enabled by default, if i read the page linked to by 
the previous post correctly. I checked my /tmp disk and it does contain the .longfilenames file.

Any other ideas what might go wrong here?


Martin



_______________________________________________

QNX Momentics Community Support
http://community.qnx.com/sf/go/post58801

Re: RE: RE: devb-ram disk, trouble with long filenames  
I found this discussion interesting and thought that I can help in locating ".longfilenames". The QNX help says that it 
must be in the root directory.

One method that I use to search for files in the file system is:
*Go to the upper most folder in your file system
*type the command "ls -R" at this upper most folder and it will recursively list all the files present in the file 
system. 
*then simply copy the output on to a notepad and do a simple Ctrl+F search for "longfilenames". If the such a file is 
present in the file system, then you should find its location.
Re: devb-ram disk, trouble with long filenames  
Hi guys.

Thanks again for your help.

Mario: Yeah, /tmp is a real mount point, and there's no conflicts with existing folders. I shall try making a shell 
script that touches 300 or so files with long names to see if I can reproduce the error outside of the application that 
I am seeing this error from. I haven't tried it on a real HD yet, since there's no HD in the target system, but I guess 
I could try it on host to see if I can figure out if it's the devb-ram driver or the qnx4 file system. However, I have 
now changed my application to generate much shorter filenames, and this works well. Since a workaround is in place I do 
not know if I can afford to look any further into this. But if I do get some spare time and manage to figure out what's 
wrong I'll post whatever I find.

Sunil: .longfilenames is present. I just did ls-al /tmp to find that out. But thanks for your help, I'm sure I'm gonna 
need ls -R some day! A tip back at you: type 
find / -name .longfilenames 
and go grab a cup of coffee:) Should do the same trick, without going through a text editor :)