Announcement

Collapse
No announcement yet.

Editing a filename

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Editing a filename

    I need to change a few characters in a filename:
    for example:
    Trm_SP_00M.dta
    to
    Trm_SP_M00.dta

    I have written a little code to do it then I simply use:
    FILECOPY FilePathStr+FileNameStr, FilePathStr+DestFile
    KILL FilePathStr+FileNameStr

    To copy the old file to a new file with the new name (DestFile)

    The problem is this slooooooow.
    each file is about 2mb and i have to convert 120 files at once. My program slows to a crawl while the HD catchs up

    SO, is there a way to access the filename directly and change it without copying the file?

    ------------------
    Kind Regards
    Mike

  • #2
    Use the NAME statement.

    ------------------
    Tom Hanlin
    PowerBASIC Staff

    Comment


    • #3
      Name Trm_SP_00M.dta As Trm_SP_M00.dta

      Tom hit that one...

      I had this issue a while back and walah, Name is quick and efficient and can do those 120 files downright quick..




      ------------------
      Scott
      Scott Turchin
      MCSE, MCP+I
      http://www.tngbbs.com
      ----------------------
      True Karate-do is this: that in daily life, one's mind and body be trained and developed in a spirit of humility; and that in critical times, one be devoted utterly to the cause of justice. -Gichin Funakoshi

      Comment

      Working...
      X