FileException
import dshould; Path root = createTempPath(); scope(exit) root.remove(); // Create a file in some directory root.join("test-dir", "subdir").mkdir(true); root.join("test-dir", "subdir", "test-file.txt").writeFile("Hello!"); // Create a symlink for created file root.join("test-dir", "subdir", "test-file.txt").symlink( root.join("test-symlink.txt")); // Create a symbolik link to directory root.join("test-dir", "subdir").symlink(root.join("dirlink")); // Test that symlink was created root.join("test-symlink.txt").exists.should.be(true); root.join("test-symlink.txt").isSymlink.should.be(true); root.join("test-symlink.txt").readFile.should.equal("Hello!"); // Test that readlink and realpath works fine root.join("test-symlink.txt").readLink.should.equal( root.join("test-dir", "subdir", "test-file.txt")); version(OSX) { root.join("test-symlink.txt").realPath.should.equal( root.realPath.join("test-dir", "subdir", "test-file.txt")); } else { root.join("test-symlink.txt").realPath.should.equal( root.join("test-dir", "subdir", "test-file.txt")); } root.join("dirlink", "test-file.txt").readLink.should.equal( root.join("dirlink", "test-file.txt")); version(OSX) { root.join("dirlink", "test-file.txt").realPath.should.equal( root.realPath.join("test-dir", "subdir", "test-file.txt")); } else { root.join("dirlink", "test-file.txt").realPath.should.equal( root.join("test-dir", "subdir", "test-file.txt")); }
Create symlink for this file in dest path.