FoxWolfie Galen
2009-08-07 08:19:34 UTC
I'm having a problem with processing some files. The filenames are not
created by me, so I have no control over what they will be.
I am using Win 98se with 4DOS 8.00.
I have Win95SFNSearch set to no, and prefer to leave it that way.
The problem is when there are spaces in the filenames is wish to process.
How would I cause these two lines to set the filedate and filetime to
variables, as I intend, assuming there are spaces in the name?
set fd=%@filedate[%fl,,s]
set ft=%@filetime[%fl,,s]
Try a name like "m 100 ani frame 02.gif"
I tried dozens of variations, and get errors similar to the following:
D:\PICS\GI.BAT [31] File not found "C:\AnimWork\m"
set fd=
D:\PICS\GI.BAT [31] File not found "C:\AnimWork\100"
set fd=
D:\PICS\GI.BAT [31] File not found "C:\AnimWork\ani"
set fd=
D:\PICS\GI.BAT [31] File not found "C:\AnimWork\frame"
set fd=
D:\PICS\GI.BAT [31] File not found "C:\AnimWork\02.gif"
set fd=
D:\PICS\GI.BAT [32] File not found "C:\AnimWork\m"
set ft=
D:\PICS\GI.BAT [32] File not found "C:\AnimWork\100"
set ft=
D:\PICS\GI.BAT [32] File not found "C:\AnimWork\ani"
set ft=
D:\PICS\GI.BAT [32] File not found "C:\AnimWork\frame"
set ft=
D:\PICS\GI.BAT [32] File not found "C:\AnimWork\02.gif"
set ft=
Here are some of what I tried:
set fd=%@filedate["%fl",,s]
set ft=%@filetime["%fl",,s]
I thought the quotes would be enough to force the name to be a single
entity.
set fd=%@filedate[".\%fl",,s]
set ft=%@filetime[".\%fl",,s]
set fd=%@filedate["%@filename[%fl]",,s]
set ft=%@filetime["%@filename[%fl]",,s]
set fd=%@filedate[%@filename[%@sfn[%fl]],,s]
set ft=%@filetime[%@filename[%@sfn[%fl]],,s]
This last one held promise, as it gave the following errors:
D:\PICS\GI.BAT [31] File not found "C:\AnimWork\M100AN~2.GIF"
set fd=
D:\PICS\GI.BAT [32] File not found "C:\AnimWork\M100AN~2.GIF"
set ft=
Doing a "dir /nx" revealed that the file "M100AN~2.GIF" does exist, and is
the SFN of "m 100 ani frame 02.gif", in this case. Temporarily restarting
with Win95SFNSearch enabled, allows this to work, but I really don't want
to run with that on, due to other issues it causes.
What else can I do to get filenames containing spaces to work with the
internal variable functions? Is there a way to temporarily toggle
Win95SFNSearch from within a batch file? I'd settle for something like
that, so long as I could always be sure it was off outside the context of
the batch file. I tried using ' ' quotes instead of " " quotes. They
caused the long filename to be treated as one unit, but the quotes became
part of the name, and therefore caused it to fail. I also tried enclosing
the filenames in [ ] characters, with no luck.
created by me, so I have no control over what they will be.
I am using Win 98se with 4DOS 8.00.
I have Win95SFNSearch set to no, and prefer to leave it that way.
The problem is when there are spaces in the filenames is wish to process.
How would I cause these two lines to set the filedate and filetime to
variables, as I intend, assuming there are spaces in the name?
set fd=%@filedate[%fl,,s]
set ft=%@filetime[%fl,,s]
Try a name like "m 100 ani frame 02.gif"
I tried dozens of variations, and get errors similar to the following:
D:\PICS\GI.BAT [31] File not found "C:\AnimWork\m"
set fd=
D:\PICS\GI.BAT [31] File not found "C:\AnimWork\100"
set fd=
D:\PICS\GI.BAT [31] File not found "C:\AnimWork\ani"
set fd=
D:\PICS\GI.BAT [31] File not found "C:\AnimWork\frame"
set fd=
D:\PICS\GI.BAT [31] File not found "C:\AnimWork\02.gif"
set fd=
D:\PICS\GI.BAT [32] File not found "C:\AnimWork\m"
set ft=
D:\PICS\GI.BAT [32] File not found "C:\AnimWork\100"
set ft=
D:\PICS\GI.BAT [32] File not found "C:\AnimWork\ani"
set ft=
D:\PICS\GI.BAT [32] File not found "C:\AnimWork\frame"
set ft=
D:\PICS\GI.BAT [32] File not found "C:\AnimWork\02.gif"
set ft=
Here are some of what I tried:
set fd=%@filedate["%fl",,s]
set ft=%@filetime["%fl",,s]
I thought the quotes would be enough to force the name to be a single
entity.
set fd=%@filedate[".\%fl",,s]
set ft=%@filetime[".\%fl",,s]
set fd=%@filedate["%@filename[%fl]",,s]
set ft=%@filetime["%@filename[%fl]",,s]
set fd=%@filedate[%@filename[%@sfn[%fl]],,s]
set ft=%@filetime[%@filename[%@sfn[%fl]],,s]
This last one held promise, as it gave the following errors:
D:\PICS\GI.BAT [31] File not found "C:\AnimWork\M100AN~2.GIF"
set fd=
D:\PICS\GI.BAT [32] File not found "C:\AnimWork\M100AN~2.GIF"
set ft=
Doing a "dir /nx" revealed that the file "M100AN~2.GIF" does exist, and is
the SFN of "m 100 ani frame 02.gif", in this case. Temporarily restarting
with Win95SFNSearch enabled, allows this to work, but I really don't want
to run with that on, due to other issues it causes.
What else can I do to get filenames containing spaces to work with the
internal variable functions? Is there a way to temporarily toggle
Win95SFNSearch from within a batch file? I'd settle for something like
that, so long as I could always be sure it was off outside the context of
the batch file. I tried using ' ' quotes instead of " " quotes. They
caused the long filename to be treated as one unit, but the quotes became
part of the name, and therefore caused it to fail. I also tried enclosing
the filenames in [ ] characters, with no luck.
--
FoxWolfie / CubCoon
FoxWolfie / CubCoon