Page 2 of 2

Posted: Fri 22 Jun 2007, 12:00
by BarryK
Puppy-1 didn't have a problem closing ROX, but ROX in Puppy-2 has changed.
Puppy-2 has no problem either. Pmount uses 'rox -D <path>', no problem.

It's working nicely for me. Grab the 2.17alpha mid-week and test it.

Yes, the initrd.gz, I wasn't sure about that one. It's something only developers would want to open.

Posted: Fri 22 Jun 2007, 22:11
by Béèm
I have downloaded and installed this filemnt.gz now.
I don't see how it interacts with ROX, so I copied the filemnt bin on the desktop and dropped a sfs on it. (blabla.sfs)

I then look in /mnt and find indeed a new directory of which the contents is indeed the one od blabla.sfs, but I find the name of the directory odd with all the + signs in there. What is the signification?

Posted: Sat 23 Jun 2007, 00:21
by sunburnt
Beem; Linux doesn't allow "/" in file or dir. names, so to make unique dirs.
to use as mount points for the image files, I convert the paths "/" to "+".
I chose the "+" character instead of "-" & "_" because they're commonly
used to name dirs. & files, so the names unique & can be reconverted back.

So to look at the /mnt dir. you see: +Path+ImageFile as the mount dir.

Posted: Sat 23 Jun 2007, 08:01
by willhunt
just a thought but if you changed line 11 from

Code: Select all

MntPt='/mnt/'`echo "$imgFile" |sed "s#^\.##g" |sed "s#/#+#g"`
to

Code: Select all

MntPt=/mnt/${imgFile##/*/}
then would it make the mount point /mnt/NameOfFile ?

Posted: Sat 23 Jun 2007, 08:26
by Béèm
sunburnt, I understand now the reason why you did as you do.
I was gonna make a suggestion, but willhunt did beat me by 20 minutes with the extra advantage he proposed a code. :)
I wouldn't know how to suggest it with a code. :?

But I still have the idea to do the mount in a more intuitive way by going to the file in ROX and doing a right click select mount as action.
And the action would probably be your filemnt program.

Posted: Sat 23 Jun 2007, 19:45
by sunburnt
Beem; See my post in the Suggestions forum about ROX.

willhunt; Using just the file name wouldn't allow mounting 2 pup_save.2fs files.
Say you wanted to copy files from one Save or work image file to another.
Using the path with the file name assures that there's no dup. mount points.
If the new mount point is the same as the old one, then the new file will be
mounted over the top of the older one & the old one can't be accessed.
This is an interesting result of mounting files over files, quite useful at times
as it causes the mounted image files to act like a stack... Last on, first off.

Posted: Sat 23 Jun 2007, 23:25
by Béèm
willhunt wrote:just a thought but if you changed line 11 from

Code: Select all

MntPt='/mnt/'`echo "$imgFile" |sed "s#^\.##g" |sed "s#/#+#g"`
to

Code: Select all

MntPt=/mnt/${imgFile##/*/}
then would it make the mount point /mnt/NameOfFile ?
Yes indeed.
I changed that code and now I have /mnt/NameOfFile

Posted: Sun 24 Jun 2007, 00:09
by sunburnt
It'll be fine until you have 2 image files with the same name...

I'm not sure just what the problem is with: /mnt/+Path+FileName
And I'm not sure why /mnt/FileName is an improvement, because it's not.

Posted: Sun 24 Jun 2007, 03:18
by willhunt
sunburnt I understand why you did it that way I did not mean to suggest it was better just different :(
if you addthison line 68

Code: Select all

if [ -f $MntPt ] ;then gxmessage "That mount point exisits please rename one of your files" ;exit 3 ;fi[code]
it should solve any problem that might arise
right?

Posted: Sun 24 Jun 2007, 04:40
by sunburnt
Yes, my suggestion was going to be to check for a preexisting mount point.
However, mount points are dirs. & not files ( if [ -d $MntPt ];then ).
This just stops duplicate image files from being mounted, not the best arrangement.

I'm just puzzled as to why you want to change code that does a better job.
My code will mount any number of image files, anywhere, with no conflicts.
I don't understand exactly what it is that your attempting to accomplish.

Posted: Sun 24 Jun 2007, 05:57
by willhunt
learn

Give a man a fish he eats a meal teach a man to fish he eats a lifetime and maybe he teachs someone else :D

Posted: Sun 24 Jun 2007, 20:45
by sunburnt
Aaaahhhhhhhhh; That's always a very rewarding effort, worthy of assistance.

If you want you could use the original method I used before going to the /mnt/+Path+File method.
That is adding a number to the file's mount point dirs. to make them unique.
If you want, I'll post code to do this, but you should be able to handle it no prob.
Rather than an arbitrary number, use the number of the next loop device.
So the mount point would be: FileName_LoopNumber ..... (pup_save.2fs_4).
To set the loop device that's to be used for mounting, use "losetup".

Posted: Sun 24 Jun 2007, 21:25
by Béèm
In ROX and right-click on a sfs, 2fs or 3fs and by editing Menu to load filemnt, filemt is in the menu now and any such file can be mounted by right click.
Nice.
The unmount should still be done manually however.

Posted: Sun 24 Jun 2007, 21:52
by GuestToo
Rather than an arbitrary number, use the number of the next loop device
or you could use the pid of the current process ... $$

or you could use uuidgen to generate an alphanumeric string that is almost guaranteed to be unique

Posted: Tue 26 Jun 2007, 08:16
by willhunt
thanks for the tips sunburnt and GuestToo I got how sunburnt did
his but once you use the pid uuidgen how do you glean the
new name?