[Gambas-user] Please help with directory problem
Kari Laine
klaine8 at ...626...
Fri Oct 31 22:52:51 CET 2008
On Fri, Oct 31, 2008 at 2:57 PM, Benoit Minisini <
gambas at ...1...> wrote:
> On vendredi 31 octobre 2008, Kari Laine wrote:
> > Thanks Benoit !
>
> I often forget the WAIT keyword after a SHELL or EXEC command, so now I
> think
> this syntax was not a really good idea.
>
> I should have used the opposite syntax, i.e. a keyword like "BACKGROUND"
> or "DO NOT WAIT"!
>
>
Hi,
I still have a problem.
The routine is now following
PUBLIC SUB makedirs(sHak AS String)
DIM haks AS NEW String[300]
DIM hak2 AS String
DIM crtdir AS String
crtdir = "/home/kari/backup_work/cdroot/"
haks = Split(sHak, "/")
FOR EACH hak2 IN haks
IF hak2 = "" THEN CONTINUE
crtdir = crtdir &/ hak2
'SHELL "mkdir " & crtdir
'TRY MKDIR crtdir
SHELL "mkdir " & crtdir WAIT
'PRINT crtdir
NEXT
END
----------------------------------
and I get output
---------------------------------
mkdir: cannot create directory `/home/kari/backup_work/cdroot/home': File
exists
mkdir: cannot create directory `/home/kari/backup_work/cdroot/home/kari':
File exists
mkdir: cannot create directory
`/home/kari/backup_work/cdroot/home/kari/ulkoiset': File exists
mkdir: cannot create directory
`/home/kari/backup_work/cdroot/home/kari/ulkoiset/sdi1': File exists
mkdir: cannot create directory
`/home/kari/backup_work/cdroot/home/kari/ulkoiset/sdi1/debian_src': File
exists
mkdir: cannot create directory
`/home/kari/backup_work/cdroot/home/kari/ulkoiset/sdi1/debian_src/
ftp.fi.debian.org': File exists
mkdir: cannot create directory
`/home/kari/backup_work/cdroot/home/kari/ulkoiset/sdi1/debian_src/
ftp.fi.debian.org/debian': File exists
mkdir: cannot create directory
`/home/kari/backup_work/cdroot/home/kari/ulkoiset/sdi1/debian_src/
ftp.fi.debian.org/debian/pool': File exists
mkdir: cannot create directory
`/home/kari/backup_work/cdroot/home/kari/ulkoiset/sdi1/debian_src/
ftp.fi.debian.org/debian/pool/main': File exists
[NOTE HERE THAT MAIN EXISTS]
mkdir: cannot create directory
`/home/kari/backup_work/cdroot/home/kari/ulkoiset/sdi1/debian_src/
ftp.fi.debian.org/debian/pool/main/o': File exists
/home/kari/ulkoiset/sdi1/debian_src/
ftp.fi.debian.org/debian/pool/main/o/openal/openal_0.0.8-1.diff.gz
936003467 4651712512
mkdir: cannot create directory `/home/kari/backup_work/cdroot/home': File
exists
mkdir: cannot create directory `/home/kari/backup_work/cdroot/home/kari':
File exists
mkdir: cannot create directory
`/home/kari/backup_work/cdroot/home/kari/ulkoiset': File exists
mkdir: cannot create directory
`/home/kari/backup_work/cdroot/home/kari/ulkoiset/sdi1': File exists
mkdir: cannot create directory
`/home/kari/backup_work/cdroot/home/kari/ulkoiset/sdi1/debian_src': File
exists
mkdir: cannot create directory
`/home/kari/backup_work/cdroot/home/kari/ulkoiset/sdi1/debian_src/
ftp.fi.debian.org': File exists
mkdir: cannot create directory
`/home/kari/backup_work/cdroot/home/kari/ulkoiset/sdi1/debian_src/
ftp.fi.debian.org/debian': File exists
mkdir: cannot create directory
`/home/kari/backup_work/cdroot/home/kari/ulkoiset/sdi1/debian_src/
ftp.fi.debian.org/debian/pool': File exists
mkdir: cannot create directory
`/home/kari/backup_work/cdroot/home/kari/ulkoiset/sdi1/debian_src/
ftp.fi.debian.org/debian/pool/main': No such file or directory
[NOTE HERE THAT IT SAYS MAIN DOES NOT EXIST - SO IT GOT SOMEHOW DELETED
????]
mkdir: cannot create directory
`/home/kari/backup_work/cdroot/home/kari/ulkoiset/sdi1/debian_src/
ftp.fi.debian.org/debian/pool/main/o': No such file or directory
mkdir: cannot create directory
`/home/kari/backup_work/cdroot/home/kari/ulkoiset/sdi1/debian_src/
ftp.fi.debian.org/debian/pool/main/o/openal'/home/kari/ulkoiset/sdi1/debian_src/ftp.fi.debian.org/debian/pool/main/o/openal/openal_0.0.8.orig.tar.gz<http://ftp.fi.debian.org/debian/pool/main/o/openal%27/home/kari/ulkoiset/sdi1/debian_src/ftp.fi.debian.org/debian/pool/main/o/openal/openal_0.0.8.orig.tar.gz>
936009662 4651712512
: No such file or directory
I will run more tests but I am pretty much lost with this problem.
Best Regards
Kari Laine
More information about the User
mailing list