I vaguely remember some code posted to create Hard Links. Check on Tech DB, but didn't find anything initially. Is there any code pre-written?
You could shell-out and use mklink or use something like the following
strNew = "C:\Temp2\HardLink.txt"
strExisting = "C:\Temp\Test.txt"
bResult = DllCall("Kernel32.dll", long:"CreateHardLinkA", lpstr:strNew, lpstr:strExisting, long:0)
if !bResult then Message("System Error", " Reported last error = ":DllLastError())
Thank you.
;==================================================================================================================================;
; ;
; FUNZIONE COSTRUZIONE HARD LINK ;
; ;
;==================================================================================================================================;
; ;
; Questa funzione genera un nuovo Hard Link corrispondente ad un Hard link esistente; in pratica genera un secondo nome di file ;
; che punta agli stessi dati senza effettuare la copia del file stesso ( per chiarimenti vere informzioni specifiche sugli Hard ;
; Links ). ;
; ;
; Argomenti: ;
; sExistingLink : Path completo di un Hard Link ( Nome File ) esistente da utilizzare come base ;
; sNewLink : Path completo del nuovo Hard Link ( Nome File ) da generare che punteràagli stessi dati del link ;
; puntati da sExistingLink ;
; ;
; Ritorna: ;
; 0 Hard Link giàesistente ;
; 1 Hard Link generato ;
; 2 Path non esistente ;
; ;
;==================================================================================================================================;
#DefineFunction HardLinkMake ( sExistingLink, sNewLink )
Return DllCall("Kernel32.dll", long:"CreateHardLinkA", lpstr:sNewLink, lpstr:sExistingLink, long:0)
#EndFunction
Quote from: archimede on September 27, 2013, 06:03:51 AM
;==================================================================================================================================;
; ;
; FUNZIONE COSTRUZIONE HARD LINK ;
; ;
;==================================================================================================================================;
; ;
; Questa funzione genera un nuovo Hard Link corrispondente ad un Hard link esistente; in pratica genera un secondo nome di file ;
; che punta agli stessi dati senza effettuare la copia del file stesso ( per chiarimenti vere informzioni specifiche sugli Hard ;
; Links ). ;
; ;
; Argomenti: ;
; sExistingLink : Path completo di un Hard Link ( Nome File ) esistente da utilizzare come base ;
; sNewLink : Path completo del nuovo Hard Link ( Nome File ) da generare che punteràagli stessi dati del link ;
; puntati da sExistingLink ;
; ;
; Ritorna: ;
; 0 Hard Link giàesistente ;
; 1 Hard Link generato ;
; 2 Path non esistente ;
; ;
;==================================================================================================================================;
#DefineFunction HardLinkMake ( sExistingLink, sNewLink )
Return DllCall("Kernel32.dll", long:"CreateHardLinkA", lpstr:sNewLink, lpstr:sExistingLink, long:0)
#EndFunction
Is the above WinBatch code Italian?
Quote from: DAG_P6 on September 28, 2013, 08:50:46 AMIs the above WinBatch code Italian?
There's a great joke in there about Microsoft, but I can't seem to put my hands on it...
Yes, it's italian.
I made it for me (I'm Italian) and I copied like I made.
If you need I can translat for you; do you need it?
Quote from: archimede on October 01, 2013, 05:47:04 AM
Yes, it's italian.
I made it for me (I'm Italian) and I copied like I made.
If you need I can translat for you; do you need it?
Thank you very kindly for offering a translation.
However, I don't need it translated.
I asked the question because I was testing my skill at identifying the language in which it is written. I have read and used source code with comments and variable names in German, Spanish, Portuguese, and Swedish. Since I can read enough Italian to work out the essence of your comments, I don't need them translated.
It is amazing how far you can go with two years each of Latin and German, and one of Spanish, all taken in high school, over 40 years ago, and exposure to German and Spanish since then. Being able to use source codes with comments and names written in multiple spoken languages is a real Godsend.