Esempio n. 1
0
        public async Task AddUpload(FSItem parent, string file)
        {
            var fileinfo = new FileInfo(file);
            var info     = new UploadInfo
            {
                Id       = Guid.NewGuid().ToString(),
                Length   = fileinfo.Length,
                Path     = Path.Combine(parent.Path, Path.GetFileName(file)),
                ParentId = parent.Id
            };

            var path = Path.Combine(cachePath, info.Id);

            SymbolicLink.CreateFile(file, path);

            await WriteInfo(path + ".info", info);

            leftUploads.Add(info);
            allUploads.TryAdd(info.Id, info);
            OnUploadAdded?.Invoke(info);
        }
Esempio n. 2
0
 internal static extern bool CreateSymbolicLink(
     string lpSymlinkFileName,
     string lpTargetFileName,
     SymbolicLink dwFlags);