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

Offline qwertyqwerty

  • Planewalker
  • *****
  • Posts: 37
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%~
  END
  MOVE ~override/%BASH_FOR_FILE%~ ~biff2/prod/0/biffs/%currentFile%/%BASH_FOR_FILE%~
  OUTER_SET currentTotal += BASH_FOR_SIZE
END

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: 770
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).

 

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.

Name: Email:
Verification:
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)?: