Hi together,
I tried to communicate between 2 programs and I use files to do this.
I simply check if a specific file exits and than I delete it.
For the check I use the FileSize() procedure as suggested.
On the normal filesystem (ext3) it works.
To avoid many harddisk accesses I installed a ramdisk with
mount -t tmpfs tmpfs /tmp/ramdisk -o size=64k,mode=01777
The disks works. I can read and write to the disk.
But FileSize("/tmp/ramdisk/test") hangs.
Any idea ???
Best regards,
Bernd
[Solved} 4.30 FileSize() on a RAM disk
[Solved} 4.30 FileSize() on a RAM disk
Last edited by infratec on Sat Jan 17, 2009 6:53 pm, edited 1 time in total.
- flaith
- Enthusiast

- Posts: 704
- Joined: Mon Apr 25, 2005 9:28 pm
- Location: $300:20 58 FC 60 - Rennes
- Contact:
hi,
i tried the same way under Debian etch but inside mnt directory :
Put everything you want inside "test.txt"
With Pb a gives 22
so it works
i tried the same way under Debian etch but inside mnt directory :
Code: Select all
flaith@wooky:/mnt$ sudo mkdir ramdisk
flaith@wooky:/mnt$ sudo mount -t tmpfs tmpfs /mnt/ramdisk/ -o size=64k,mode=01777
flaith@wooky:/mnt$ cd ramdisk/
flaith@wooky:/mnt/ramdisk$ vi test.txtWith Pb a
Code: Select all
Debug FileSize("/mnt/ramdisk/test.txt")so it works
“Fear is a reaction. Courage is a decision.” - WC
the x part was just guessed. so it just needs read rights - had not too much time but in my case i had the wrong permissions set on the dir inside mnt while accessing from a non sudo'ed user ... :roll: -- clearly sometimes a day working with windows can hurt your thinking lol 
"In 3D there is never enough Time to do Things right,
but there's always enough Time to make them *look* right."
"psssst! i steal signatures... don't tell anyone!
"
but there's always enough Time to make them *look* right."
"psssst! i steal signatures... don't tell anyone!
Now I'm at home and I checked it with my Kubuntu 8.10 installation.
Result:
FileSize() works correct!
I have an other problem:
Directly behind the filesize check I try to delete the file in an endless loop.
And that is my problem.
At work I can't see this, because the target PC has only 800x600 screen resolution,
and than I can not read the PureBASIC Menu and output: it is to small.
I have to check this now.
As normal user I can not delete a file from user root, but it has 666 as rights.
So it should be possible.
Bernd
Result:
FileSize() works correct!
I have an other problem:
Directly behind the filesize check I try to delete the file in an endless loop.
And that is my problem.
At work I can't see this, because the target PC has only 800x600 screen resolution,
and than I can not read the PureBASIC Menu and output: it is to small.
I have to check this now.
As normal user I can not delete a file from user root, but it has 666 as rights.
So it should be possible.
Bernd
Hi ,
PROBLEM SOLVED !
It was the mount command!
I set the sticky bit, that was my fault.
With the sticky bit on a directory, only the owner can do a delete,
even when the rights are 666 or 777.
And when I tried it in /tmp, I didn't recognize that kubuntu also has the sticky bit on the
/tmp directory!
(I think on SuSE /tmp has no sticky bit set)
So:
If you want to use a RAM disk as information exchange directory, where the files should be fully accessible, use mode=0777 and not mode=01777
Best regards and thanks,
Bernd
PROBLEM SOLVED !
It was the mount command!
I set the sticky bit, that was my fault.
With the sticky bit on a directory, only the owner can do a delete,
even when the rights are 666 or 777.
And when I tried it in /tmp, I didn't recognize that kubuntu also has the sticky bit on the
/tmp directory!
(I think on SuSE /tmp has no sticky bit set)
So:
If you want to use a RAM disk as information exchange directory, where the files should be fully accessible, use mode=0777 and not mode=01777
Best regards and thanks,
Bernd
