[Win32utils-devel] Ruby code to create junctions on NTFS volumes.

Timothy Byrd timbyrd at pobox.com
Mon Mar 14 04:03:02 EST 2005


Here is some Ruby code for creating junctions on NTFS volumes.

These are the main routines:

Dir.junction?(dir) => true if dir is a junction

Dir.reparse_target(dir) => returns the target of a junction, or dir

Dir.create_junction(junctName, existingTarget) => creates a junctName 
junction pointing to existingTarget

(also used (Dan's?) GetLastError code and did some simple wide/narrow 
character conversion)

-- Timothy

-------------- next part --------------
A non-text attachment was scrubbed...
Name: junction.rb
Type: application/octet-stream
Size: 17601 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/win32utils-devel/attachments/20050314/72060489/junction-0001.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: junction_sample.rb
Type: application/octet-stream
Size: 730 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/win32utils-devel/attachments/20050314/72060489/junction_sample-0001.obj


More information about the win32utils-devel mailing list