R Under development (unstable) (2023-11-16 r85542 ucrt) -- "Unsuffered Consequences" Copyright (C) 2023 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library("R.utils") Loading required package: R.oo Loading required package: R.methodsS3 R.methodsS3 v1.8.2 (2022-06-13 22:00:14 UTC) successfully loaded. See ?R.methodsS3 for help. R.oo v1.25.0 (2022-06-12 02:20:02 UTC) successfully loaded. See ?R.oo for help. Attaching package: 'R.oo' The following object is masked from 'package:R.methodsS3': throw The following objects are masked from 'package:methods': getClasses, getMethods The following objects are masked from 'package:base': attach, detach, load, save R.utils v2.12.3 successfully loaded. See ?R.utils for help. Attaching package: 'R.utils' The following object is masked from 'package:utils': timestamp The following objects are masked from 'package:base': cat, commandArgs, getOption, isOpen, nullfile, parse, warnings > > > pathname <- system.file("data-ex/HISTORY.LNK", package="R.utils") > lnk <- readWindowsShortcut(pathname, verbose=TRUE) File header read: $magic [1] 76 $guid [1] 1 20 2 0 0 0 0 0 192 0 0 0 0 0 0 70 $flags [1] 159 $fileAttributes [1] 32 $creationTime [1] 755506800 $modificationTime [1] -1773539680 $lastAccessTime [1] 755113120 $fileLength [1] 606 $iconNumber [1] 0 $showWndValue [1] 1 $hotKey [1] 0 $unknown [1] 0 0 bytesToRead=497 File location info: $length [1] 127 $firstOffset [1] 28 $flags availableOnLocalVolume availableOnNetworkShare TRUE FALSE $offsetLocalVolumeInfo [1] 28 $offsetBasePathname [1] 56 $offsetNetworkVolumeInfo [1] 0 $offsetRemainingPathname [1] 126 $.offset [1] 28 availableOnLocalVolume... File location info / Local Volume Table: $typeOfVolume Fixed 3 $volumeSerialNumber [1] -2077904061 $volumeLabel [1] "IBM_PRELOAD" basePathname='C:\Documents and Settings\hb\braju.com.R\R.utils\R.utils\inst\HISTORY' availableOnLocalVolume...done > > # Print all information > print(lnk) $header $header$magic [1] 76 $header$guid [1] 1 20 2 0 0 0 0 0 192 0 0 0 0 0 0 70 $header$flags hasShellItemIdList pointsToFileOrDirectory hasDescription TRUE TRUE TRUE hasRelativePath hasWorkingDirectory hasCommandLineArguments TRUE TRUE FALSE hasCustomIcon unicodedStrings FALSE TRUE $header$fileAttributes isReadOnly isHidden isSystemFile FALSE FALSE FALSE isVolumeLabel isDirectory isModifiedSinceLastBackup FALSE FALSE TRUE isEncrypted isNormal isTemporary FALSE FALSE FALSE isSparseFile hasReparsePointData isCompressed FALSE FALSE FALSE isOffline FALSE $header$creationTime [1] 755506800 $header$modificationTime [1] -1773539680 $header$lastAccessTime [1] 755113120 $header$fileLength [1] 606 $header$iconNumber [1] 0 $header$showWndValue SW_NORMAL 1 $header$hotKey [1] 0 $header$unknown [1] 0 0 $fileLocationInfo $fileLocationInfo$flags availableOnLocalVolume availableOnNetworkShare TRUE FALSE $fileLocationInfo$localVolumeTable $fileLocationInfo$localVolumeTable$typeOfVolume Fixed 3 $fileLocationInfo$localVolumeTable$volumeSerialNumber [1] -2077904061 $fileLocationInfo$localVolumeTable$volumeLabel [1] "IBM_PRELOAD" $fileLocationInfo$basePathname [1] "C:\\Documents and Settings\\hb\\braju.com.R\\R.utils\\R.utils\\inst\\HISTORY" $fileLocationInfo$remainingPathname [1] "" $description [1] "C:\\Documents and Settings\\hb\\braju.com.R\\R.utils\\R.utils\\inst\\HISTORY" $relativePath [1] "..\\HISTORY" $workingDirectory [1] "C:\\Documents and Settings\\hb\\braju.com.R\\R.utils\\R.utils\\inst" $relativePathname [1] "..\\HISTORY" $pathname [1] "C:\\Documents and Settings\\hb\\braju.com.R\\R.utils\\R.utils\\inst\\HISTORY" > > # Get the relative path to the target file > history <- file.path(dirname(pathname), lnk$relativePath) > > # Alternatively, everything in one call > history <- filePath(pathname, expandLinks="relative") > > proc.time() user system elapsed 0.29 0.14 0.42