Hi Farfar,
Â
Â
Path delimiter may cause the error. How about using / (slash) instead of \\ (back slash)?
Â
Â
Takashi
Hi Takashi,
Â
I use "join" to have a directory path.Â
Â
this my python script :Â
Â
def processFeature(feature):      #create work folder   fmebasename = feature.getAttribute("fme_basename")   workfolder = os.path.join(FME_MacroValuesM'workFolder'],fmebasename)      if not os.path.exists(workfolder):     os.makedirs(workfolder)   else:     #delete files ito work folder     os.chdir(workfolder)     filelist = glob.glob("*.shp.zip")     for f in filelist:       os.remove(f)      # move zip file into work folder   filename = fmebasename+".shp.zip"      fmedataset =  feature.getAttribute("fme_dataset")         end = fmedataset.find(fmebasename)     src_file = fmedatasetÂ0:end]        src_file = os.path.join(src_file, filename)      dst_file = os.path.join(workfolder, filename)   shutil.move(src_file, dst_file)        pass
Â
Â
ThanksÂ
Â
Farfar
Hi,
Â
I use my script in my previous message, i replace  :
Â
workfolder = os.path.join(FME_MacroValuesu'workFolder'],fmebasename)Â
Â
by :Â
Â
workfolder = FME_MacroValueso'workFolder'] + "\\\\" + fmebasename.
Â
Â
And i still have the problem.Â
Â
Â
Any Help?Â
Â
Thanks.
Â
Farfar
Was a slash "/" also ineffectual?
Â
Â
Takashi
Hi Takasha,
Â
I tested both of "//" , Â "\\\\" and "join" function and i've a same error. But if i use a non numeric file name, it works.
Â
Â
Farfar
Â
Â
Hi,
Â
Â
the simplest might be to insert
Â
Â
print "src_file:", src_file
Â
Â
or something like that at the end of your script. This  will print to the FME log window the actual values generated by your script. Let us know what it says so that we can try and help you find the error.
Â
Â
David
Hi David,
Â
Thank you for your idea. The pb is the extract the value of "src_file" : the fme_dataset has a value that is in the path, so to split the path, its wrong.Â
Â
Example :Â
Â
  print "fmebasename:", fmebasename
Â
  fmedataset =  feature.getAttribute("fme_dataset") Â
Â
  print "fmedataset :",fmedataset   end = fmedataset.find(fmebasename)     print "fmedataset:",fmedataset   print "end:",end   src_file = fmedatasetÂ0:end]
Â
   print "src_file:", src_file
Â
Â
The result is :Â
Â
  fmebasename = 1
Â
 fmedataset : \\\\\\\\1.shp.zip\\1.shp
Â
  end:,2          ==> WRONG
Â
 src_file: \\\\1.shp.zip
Â
Â
I find now the origin of my error and fix it.
Â
Thank you
Â
Â
Farfar
Â
Â
 Â
Â
Â
Â