[Gambas-user] relative path

Charlie Reinl Karl.Reinl at ...9...
Sun Nov 15 22:22:22 CET 2009


Am Sonntag, den 15.11.2009, 17:51 +0100 schrieb Stefano Palmeri:
> Il domenica 15 novembre 2009 17:23:26 Stefano Palmeri ha scritto:
> > Il domenica 15 novembre 2009 17:05:00 Charlie Reinl ha scritto:
> > > Am Sonntag, den 15.11.2009, 15:40 +0100 schrieb Stefano Palmeri:
> > > > Il domenica 15 novembre 2009 12:42:17 Charlie Reinl ha scritto:
> > > > > Salut,
> > > > >
> > > > > I looking for a function or switch in gambas,
> > > > > which gives me the path-string as relative path
> > > > > and not the whole path up from /
> > > >
> > > > I'm not sure I understood. Do you mean
> > > >
> > > > PRINT File.BaseName("/home/user/mydocuments")
> > > >
> > > > --> mydocuments
> > > >
> > > > ?
> > > >
> > > > Stefano
> > >
> > > Salut,
> > >
> > > I mean "/home/user/myNiceProject/allOtherFiles/ThisDoc.txt"
> > > to make "allOtherFiles/ThisDoc.txt"
> 
> Errata corrige:
> 
> DIM sFullPath, sRelativePath AS String
> 
>   sFullPath = "/home/user/myNiceProject/allOtherFiles/ThisDoc.txt"
> 
>   sRelativePath = File.Name(File.Dir(sFullPath)) &/ File.Name(sFullPath)
> 
>   PRINT sRelativePath
> 
> 
> Saluti.
> 
> 
> 
> 
> 
> >
> > DIM sFullPath, sRelativePath as string
> >
> > sFullPath =  "/home/user/myNiceProject/allOtherFiles/ThisDoc.txt"
> >
> > sRelativePath= File.BaseName(File.Dir(sFullPath)) &/ file.name(sFullPath)
> >
> > PRINT sRelativePath
> >
> > --> allOtherFiles/ThisDoc.txt
> >
> > Saluti,
> >
> > Stefano
> >
> > > or "/home/user/mydocuments/allOtherFiles/ThisDoc.txt"
> > > out of "/home/user/myNiceProject" to make
> > > "../mydocuments/allOtherFiles/ThisDoc.txt"
> > >
> > > Hope that's clearer now!
> > >
> > > Even the "/home/user" replaced by "~" could be.
> > > But in a format, that all other functions which need a file as argument
> > > can handle it.
> >
Salut Stefano,

thanks for the code, I attached you my result.

And I remarked, that SQLite at least the gambas.Part couldn't handle 
with ~/SQLite3/TestDB.
 
-- 
Amicalment
Charlie
-------------- next part --------------
A non-text attachment was scrubbed...
Name: firstTry-0.0.1.RelativePath.tar.gz
Type: application/x-compressed-tar
Size: 9580 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20091115/3c3da1a8/attachment.bin>


More information about the User mailing list