VB6, Limitations of FileSystemObject

Associate
Joined
26 Feb 2004
Posts
970
Location
China (Qinhuangdao)
I've been messing around for a while with creating a backup system for my new Synology disk station. It simply goes through all my files and folders on my local drive and updates the remote drive if it needs to be.

I'm getting error messages when the total length of the path being copied across is more than 255 characters long.

I'm using object.copyfile origfile, destfile.

Is this a known issue? or is it just coincidence that the path is so long? Any way around this problem or do I need to go though all the long filenames and truncate them?
 
Soldato
Joined
25 Feb 2003
Posts
2,719
Location
Deep dark hole
Must admit, I've always recursed through the folders, so it's always only a single depth of file name. Don't think I've ever seen a problem with length of names doing it my way?
 
Soldato
Joined
17 Jun 2012
Posts
11,259
It's to do with the MAX_PATH constant, I think it goes back to the days of DOS when they assumed the 256 characters would be enough for a file/dir name.

So the default MAX_PATH in windows(API) is 256 characters although names of up to 2 bytes are actually supported.

I don't know if the FileSystemObject supports longer names though.
 
Back
Top Bottom