Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
renaming files, while adding numbers to it
#21
Also, if you copy for example a file called "LongFileName.txt" from C: to D: from qbasic (opening "C:\LONGFI~1.TXT" for input and "D:\LONGFI~1.TXT" for output and stuff) the resulting file will lose its long filename, so it is better to avoid using QB built-in file functions when dealing with such files.
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#22
Absolutely right, Nathan. Copying a file from drive to drive as well as to another directory, will cause the same problem. When you copy a file using Windows or from the DOS-Shell, even if you use the short filename, it still copies the long filename to the destination. Since QB cannot reference the long name, and Windows is not actually doing the copy, you'll end up with only the short name, like you said.

I suspect that there must be some assembly language function that could be called form QB to be able to handle long filenames. Maybe I'm dreaming.
*****
Reply
#23
You're not: http://faq.qbasicnews.com/?blast=LongFilenames
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#24
I tried something whitetiger suggested. Doesn't work. It says 'Bad file name'. I thought +'s were allowed here. Why not?

CHDIR "g:\onzin"
FOR i = 1 TO 5
OPEN "ding" + CHR$(i) + ".cot" FOR INPUT AS #1
OPEN "nieuw" + CHR$(i) + ".bla" FOR OUTPUT AS #2
DO UNTIL EOF(1)
LINE INPUT #1, info$
WRITE #2, info$
LOOP
CLOSE #2
CLOSE #1
NEXT i
PRINT "end of prog."
Reply
#25
Replace CHR$ by STR$.

CHR$(1) to CHR$(5) are weird control characters that aren't allowed in filenames. I guess you wanted 1 to 5 in your filename, use LTRIM$(STR$( instead of CHR$(.
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)