Sunday, 7 April 2013

Re: [gccsdk] Name conversion catches

In message <331c1a3753.beeb@ron1954.woosh.co.nz>
Ron <beeb@woosh.co.nz> wrote:

> In message <80a4493553.beeb@ron1954.woosh.co.nz>
> Ron <beeb@woosh.co.nz> wrote:
> <snip>
> > >
> > > I checked Linux and you cant create "." or ".." but you can
> > > create "..."
> > > I have experimented and found I have my own conversion for the
> > > parsed top directory doing an 'up directory' when named "/" and on
> > > the subdirectories/files (tar internally) unixlib is just skipping
> > > everything below a "/" or "//"
> > >
> >
> > <snip>
> > An easy way to examine the current unixlib conversion is to have
> > !Moonfish running and the shared directory open in RISC OS and Linux
> > simultaneously
> >
> > I think the most natural way to allow "./." ".//." is to escape them
> > with the "\" character as this can be entered from the Linux side
> > in a normal way.
> > "\.\." as a name is OK under Linux and would allow creation of this
> > legitimate in RISC OS name, but the escape character "\" is being
> > converted to "?5C" at the moment.
> > Given that "\" is not allowed in a RISC OS name, I think all
> > occurrences of it could simply be removed at riscosifying time.
> > Instances of "./." or any number of purely "/" characters in a name
> > would be a special case requiring them to be preceded by as many
> > "\" as needed at unixifying time.
> >
> > I am looking for the most likely way it would be implemented in
> > unixlib permanently so it would give all programs using ,xyz
> > compatibility one day.
> >
> > Ron M.
> >
>
> Unfortunately it is not so simple, the linux tar does not allow
> the '\' character in a name the way !moonfish and the linux filer
> can, possibly because it conflicts with Dos separators, I don't know.
> So the only possibility would be to subsitute the '/' '//'
> with a tar compatible character that can't be used in a RISC OS name.
> But it may be better just to abide by a few rules and maintain
> proper cross platform compatibility without the strange characters.
>

Thanks to Ralph, who pointed out by email that Linux tar does in fact
allow "\.\."
I was using Engrampa (Archive manager for MATE) which does not.
As suggested, 'tar cvf - . | tar tvf -' displays that example as
"\\.\\." and Ralph also made a valid point that extra characters will
increase the total length of the path. (four characters in this case)

An "inhouse" method would be to change "/" "//" "///" etc to "%" "%%"
Using only my RISC OS tar the change would be transparent,
but the directories dont get lost and on another viewer just slightly
changed.
Interestingly, Spark will not read "\\.\\." back, but it will
convert "%" to ";" So what left RISC OS in my tar as "./." would
get back via Spark as ".;."
Not good, but no files would be lost. "%" is not allowed in a
RISC OS name so there is no possibility of a double up of names.
In RISC OS, "%" denotes (Macro?) the Library directory, but I would
only be using it outside of RISC OS, The same applies to "\"
which denotes PSD.

Ron M.




_______________________________________________
GCCSDK mailing list gcc@gccsdk.riscos.info
Bugzilla: http://www.riscos.info/bugzilla/index.cgi
List Info: http://www.riscos.info/mailman/listinfo/gcc
Main Page: http://www.riscos.info/index.php/GCCSDK

No comments:

Post a Comment