Sometimes it's convenient to be able to use Path.GetFileName __SOURCE_FILE__ for let's say a sender ID in logging.
|
let tempFile = Path.GetTempFileName() |
Currently __SOURCE_FILE__ resolves to a random file path generated above. Is it possible to generate a temp directory containing a script file keeping the original name?
let mutable cnt = 0
let mutable stream = null
while (
cnt <- cnt + 1
if cnt = 100 then failwith "oh no"
try
let p = Path.Join(Directory.CreateTempSubdirectory("fspack").FullName, Path.GetFileName fileName)
stream <- new FileStream(p, FileMode.CreateNew, FileAccess.Write, FileShare.Read)
false
with :? IOException -> true
) do ()
Sometimes it's convenient to be able to use
Path.GetFileName __SOURCE_FILE__for let's say a sender ID in logging.FSharpPacker/FSharpPacker.FSharp/Packer.fs
Line 13 in f2ca51a
Currently
__SOURCE_FILE__resolves to a random file path generated above. Is it possible to generate a temp directory containing a script file keeping the original name?