[CLOSED] WINDOWS: CopyFile() limit?

Just starting out? Need help? Post your questions and find answers here.
User avatar
TI-994A
Addict
Addict
Posts: 2751
Joined: Sat Feb 19, 2011 3:47 am
Location: Singapore
Contact:

[CLOSED] WINDOWS: CopyFile() limit?

Post by TI-994A »

While trying to copy a bunch of files, each with a combined path name of about 100 characters long, only the first 265 copy operations succeed, while the rest will fail.

At first I thought that the paths of the failed copy operations could be corrupted, but I tried to run them separately and they worked.

Here's a pseudocode of the routine:

Code: Select all

fileName.s = "SOME_REALLY_LONG_FILENAME_WITH_DATES_AND_CODES_AND_STUFF.txt"

OpenFile(0, foldersFile.s)

While Not Eof(0)
  
  pathName.s = ReadString(0)   ; the destination folder name
  
  fName = ; the original fileName modified with different dates and codes
          
  If CopyFile(GetCurrentDirectory() +  "\sample.txt", pathName + fName)

    Debug "sample.txt > copied to > " + pathName + fName
        
  EndIf  
   
Wend

CloseFile(0)
The paths and file names are all valid because the copy operations work if only 265 of them are performed at one go.

Anyone have any idea why the 265 limit?
Last edited by TI-994A on Mon Oct 28, 2024 6:14 pm, edited 1 time in total.
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel :D
User avatar
Kiffi
Addict
Addict
Posts: 1509
Joined: Tue Mar 02, 2004 1:20 pm
Location: Amphibios 9

Re: WINDOWS: CopyFile() limit?

Post by Kiffi »

That could have something to do with this: Maximum Path Length Limitation
Hygge
User avatar
TI-994A
Addict
Addict
Posts: 2751
Joined: Sat Feb 19, 2011 3:47 am
Location: Singapore
Contact:

Re: WINDOWS: CopyFile() limit?

Post by TI-994A »

Kiffi wrote: Mon Oct 28, 2024 5:08 pm That could have something to do with this: Maximum Path Length Limitation
Hi Kiffi. I thought that too, at first. But all the copy operations with the existing full-length paths and file names work without issue.

It only fails if an attempt is made to perform more than 265 CopyFile() operation in a single go. :?
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel :D
User avatar
TI-994A
Addict
Addict
Posts: 2751
Joined: Sat Feb 19, 2011 3:47 am
Location: Singapore
Contact:

Re: WINDOWS: CopyFile() limit?

Post by TI-994A »

Sorry everyone! Please disregard the question.

The copy operations depended on some input files, but I didn't realise that there were only 265 of them. And thus the failure. :oops:

Thank you to everyone who had spent any time investigating this. Much appreciated. :D
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel :D
Post Reply