Author Topic: Move + symlink fails  (Read 431 times)

Offline qwertyqwerty

  • Planewalker
  • *****
  • Posts: 64
Move + symlink fails
« on: January 21, 2017, 05:54:05 PM »
The following code will fail if biff2 is a symlink:
Code: [Select]
ACTION_BASH_FOR ~override~ ~%myRegExp%~ BEGIN
  ACTION_IF %BASH_FOR_SIZE% + currentTotal > 30000000 /* 30M */ && currentTotal > 0 BEGIN
    MAKE_BIFF ~biff2_%currentFile%~ BEGIN ~biff2/prod/0/biffs/%currentFile%~ ~^.*$~ END
    OUTER_SET currentFile = currentFile + 1
    OUTER_SET currentTotal = 0
    MKDIR ~biff2/prod/0/biffs/%currentFile%~
  MOVE ~override/%BASH_FOR_FILE%~ ~biff2/prod/0/biffs/%currentFile%/%BASH_FOR_FILE%~
  OUTER_SET currentTotal += BASH_FOR_SIZE

Code: [Select]
Creating 1 directory
Moving override/%B5DI.2DA to biff2/prod/0/biffs/0/%B5DI.2DA
Stopping installation because of error.
Stopping installation because of error.

ERROR Installing [Generalized Biffing 2], rolling back to previous state
[biff2/backup/0/UNSETSTR.0] SET_STRING uninstall info not found
Will uninstall   0 files for [biff2/biff2.tp2] component 0.
Uninstalled      0 files for [biff2/biff2.tp2] component 0.
Unable to Unlink [biff2/backup/0/READLN.0]: Unix.Unix_error(20, "unlink", "biff2/backup/0/READLN.0")
Unable to Unlink [biff2/backup/0/READLN.0.TEXT]: Unix.Unix_error(20, "unlink", "biff2/backup/0/READLN.0.TEXT")

I found the explanation here. But it seems ocaml does offer filesystem access, no?

Offline Wisp

  • Moderator
  • Planewalker
  • *****
  • Posts: 941
Re: Move + symlink fails
« Reply #1 on: March 18, 2017, 08:29:20 PM »
FWIW, I can't reproduce this. Have you got a self-contained test case, or working code? Creating the directory real/some/where and the symlink sym that points to real, I am able to move files to ~sym/some/where~.
I'm not terribly familiar with this stuff, but it seems like there's no impediment to making MOVE follow symlinks, if there is a present problem (though it's not in the Sys module).

Offline qwertyqwerty

  • Planewalker
  • *****
  • Posts: 64
Re: Move + symlink fails
« Reply #2 on: March 26, 2017, 01:03:13 PM »
The code is generalized_biffing mod, I just run a second instance to really empty override.
I have it some more testing, and symlink doesn't fail the installation by itself, I tried to move the dir inside game folder and link to it, it worked fine. But I can reliably reproduce it when linking to original placement.

Anyway, it's a minor issue, so probably not worth your time.


With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Name: Email:
Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture:
What color is grass?:
What is the seventh word in this sentence?:
What is five minus two (use the full word)?: