Long fully qualified filenames

J

Jesper, Denmark

Hi,
I work in a company where we tend to use very deep folder structures and
long descriptive file names due to the nature of the analysis that we make.

I've made a program that recursively descends into these folders to do some
search stuff. However, I receive an exception trown from a FileInfo object
when I'm deep down the mine shaft saying that "the specified path/file is too
long and must not exceed 248/260 respectively in characteres". Before I start
to work on some workaround, does anyone know of a way to use loooooong
filenames/paths?

regards
Jesper.
 
J

Jeff Winn

Windows MAX_PATH is 260 characters if i recall, filenames are supposed to be
a short description of the file so you can find them easily. They're not
designed to store the whole file in the filename and leave the file empty.

You could always store the files in a database of some sort to categorize
the information and use a guid for the filename. Didn't give us any
information about the project so i'm really just guessing at this point. At
any rate, if the filenames are starting to exceed max path, you need to
rethink how you're building your file system and fix it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top