help with file path exceeding 255 characters

yguan08 at gmail.com yguan08 at gmail.com
Tue May 13 18:33:17 EDT 2008


On May 13, 5:31 pm, John Machin <sjmac... at lexicon.net> wrote:
> ygua... at gmail.com wrote:
> > On May 13, 4:38 pm, John Machin <sjmac... at lexicon.net> wrote:
> >> ygua... at gmail.com wrote:
> >>> I have trouble of obtaining the file size of a file because the
> >>> fullpath exceeds 255 characters. I get this message with
> >> At the DOS command level, you can do
> >>      subst x: very\long\path
> >> and then refer to
> >>      x:filestem.ext
> >> where x is any unused drive letter.
> > Good idea. But subst does not see to work with path that has spaces.
> > It gives "Incorrect number of parameters"
>
> If any DOS command-line argument includes spaces, you need to quote it.
>
> os.system(r'subst x: "c:\my big fat path\rab oof\etc etc etc"')

Yes, it works now. I am getting more on windows after coming a long
way from Unix. Thanks a lot.



More information about the Python-list mailing list