Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Community Discussions (All other subjects)
 grr ... long file names
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 27 January 2004 :  19:23:29  Show Profile
trying to copy files/folders from one server to another. using filesystemobject and copyfolder method. working great until a really really long file name was encountered. then i got "path not found"

the file was just a word doc, but had been saved with the default that word gives ... the first sentence ... so the full path was something like c:\folder1\folder2\folder3\Application Data\Microsoft\Office\Recent\this is the really really really really really really really really really long sentence that the darn microsoft word program decided to use for the name of the file and well you get the picture.doc

so, copyfolder puked and didn't copy any of the rest of folder1. anyone know of a work around for this?

Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 27 January 2004 :  19:26:22  Show Profile  Visit HuwR's Homepage
you could always parse the filename and us the blah~1.doc notation to open it.

it may have actually barfed because of the spaces not because the name was to long, I know that the fso can have problems uploading filenames with spaces.
Go to Top of Page

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 27 January 2004 :  19:30:26  Show Profile
hmm ... yeah, it may have been the spaces. if i parse the filename, i can't just use copyfolder... i'd have to recurse through each folder, subfolder, etc. i might end up doing that. i might just use an good ole batch file using xcopy to do it.

Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~
Go to Top of Page

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 27 January 2004 :  19:50:05  Show Profile
okay, here's another question. why does the archive attribute get set on files that are copied? and folders have the read only set except its grey like it's a partial read only. i suppose it doesn't really matter, just curious.

Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~
Go to Top of Page

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 01 February 2004 :  13:36:23  Show Profile
turns out i'm having problems because the file acls are all messed up. when i try to do a copy of the folder (by parsing all the files and copying each file separately), when i encounter a file with the messed up acls, i get a permission denied error and then no more files are copied, even using on error resume next. grr... anyone have any ideas how i can simulate the /C switch with xcopy to continue when errors are encountered?

Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 01 February 2004 :  13:54:59  Show Profile  Visit HuwR's Homepage
using on error resume should work, what does your block of code look like
Go to Top of Page

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 01 February 2004 :  13:59:13  Show Profile
	set fFiles = fldr.Files
	if err.number <> 0 then
		fBUlog.WriteLine "...... error retrieving files in folder " & fPath
	else
		for each f in fFiles
			f.Copy fTo & "\" & f.Name
			if err.number <> 0 then fBUlog.WriteLine "...... error copying file " & fPath & "\" & f.Name
			err.clear
		next
	end if
	set fFiles = nothing
	err.clear

when getting to the file with problems, the red line above is not written to the file (maybe because of trying to read the name?) but it still should complete the for loop and it doesn't seem to be doing that.

Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 01 February 2004 :  14:04:53  Show Profile  Visit HuwR's Homepage
my guess is it is erroring before the f.copy and therefore not doing the loop, try adding some logging to find out, like below

if err.number <> 0 then
		fBUlog.WriteLine "...... error retrieving files in folder " & fPath
	else
		for each f in fFiles
			f.Copy fTo & "\" & f.Name
			if err.number <> 0 then fBUlog.WriteLine "...... error copying file " & fPath & "\" & f.Name
			err.clear
		next
                if err.number <> 0 then fBUlog.Writeline "...Unknown err : " & err.number"
	end if
	set fFiles = nothing
Go to Top of Page

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 01 February 2004 :  14:08:14  Show Profile
okay, i will try that when I encounter this again (I reset the permissions on the problem folder so I can't use that to test anymore). The thing is though, it copied one file successfully, then when it tried to copy the second, that's when the error occurred. then no more copying, even though there were other files with correct permissions. weird.

Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.28 seconds. Powered By: Snitz Forums 2000 Version 3.4.07