JSL을 사용하여 지정된 폴더의 볼륨을 직접 얻으려면 어떻게 해야 합니까?예를 들어 다음 폴더는 다음과 같습니다.
C:\Windows
감사해요!
콘텐츠 구성윈도우Re: JSL을 사용하여 지정된 폴더의 볼륨을 직접 가져올 수 있는 방법은 무엇입니까?나는 그것이 직접 파생 될 수 있다고 생각하지 않습니다.여기 내가 생각해 낸 것이 있습니다.
Names Default To Here( 1 );
theList = Files In Directory( "C:\Windows" );
totSize = 0;
For Each( {theFile}, theList,
totSize = Sum( totSize, File Size( "C:\Windows\" || theFile ) )
);
Show( totSize );
하지만 정확하지는 않은 것 같습니다
Re: JSL을 사용하여 지정된 폴더의 볼륨을 직접 가져올 수 있는 방법은 무엇입니까?고마워요!
Re: JSL을 사용하여 지정된 폴더의 볼륨을 직접 가져올 수 있는 방법은 무엇입니까?Re: JSL을 사용하여 지정된 폴더의 볼륨을 직접 가져올 수 있는 방법은 무엇입니까?프로그램 실행 및 일부 명령을 사용하여 이러한 유형의 검사를 수행하는 것이 더 나을 수 있습니다.
Files In Directory를 사용하면 recursive(1)를 추가해야 합니다(또는 폴더 내부의 파일을 가져오려면 직접 루프를 수행해야 합니다).
Names Default To Here(1);
lookup_dir = "C:\Windows\";
file_list = Files In Directory(lookup_dir, recursive(1));
file_sizes = Transform Each({cur_file}, file_list,
File Size(lookup_dir || cur_file)
);
sum(file_sizes);
https://www.jmp.com/support/help/en/17.0/#page/jmp/file-functions.shtml?os=win&source=application#ww4951479
이를 위해 다중 파일 가져오기를 사용할 수도 있습니다. 디렉토리 트리: 폴더가 사용하는 공간 탐색
Re: JSL을 사용하여 지정된 폴더의 볼륨을 직접 가져올 수 있는 방법은 무엇입니까?처럼 @jthi 다음은 Run Program / Powershell(물론 JMP에서 제공)을 사용하여 수행하는 방법입니다.
/*JMP STATISTICAL DISCOVERY LLC (“JMP”) PERMITS THE USE OF THIS COMPUTER SOFTWARE CODE (“CODE”) ON AN AS-IS BASIS AND AUTHORIZES YOU TO USE THE CODE SUBJECT TO THE TERMS LISTED HEREIN. BY USING THE CODE, YOU AGREE TO THESE TERMS. YOUR USE OF THE CODE IS AT YOUR OWN RISK. JMP MAKES NO REPRESENTATION OR WARRANTY, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRIGEMENT, AND TITLE, WITH RESPECT TO THE CODE.
You may use the Code solely as part of a software product you currently have licensed from JMP, JMP’s parent company SAS Institute Inc. (“SAS”), or one of JMP’s or SAS’s subsidiaries or authorized agents (the “Software”), and not for any other purpose. The Code is designed to add functionality to the Software but has not necessarily been tested. Accordingly, JMP makes no representation or warranty that the Code will operate error-free. JMP is under no obligation to maintain, support, or continue to distribute the Code.
Neither JMP nor its licensors shall be liable to you or any third-party for any general, special, direct, indirect, consequential, incidental, or other damages whatsoever arising out of or related to your use or inability to use the Code, even if JMP has been advised of the possibility of such damages. Except as otherwise provided above, the Code is governed by the same agreement that governs the Software. If you do not have an existing agreement with JMP or SAS governing the Software, you may not use the Code.
JMP and all other JMP Statistical Discovery LLC product or service names are registered trademarks or trademarks of JMP Statistical Discovery LLC in the USA and other countries. ® indicates USA registration. Other brand and product names are registered trademarks or trademarks of their respective companies.
*/
Names Default To Here( 1 );
op = {};
rp = Run Program(
Executable( "powershell.exe" ),
Options( "ls c:\temp\ -r | measure -sum Length" ), //Replace c:\temp\ with your folder
ReadFunction( Function( {this}, Insert Into( op, this << read ) ) )
);
for each ({i}, op,
if (word(1, i) == "Sum", totalsize = num(regex (i, "([0-9]+)")))
);
show (totalsize);Re: JSL을 사용하여 특정 폴더의 볼륨을 직접 가져올 수 있는 방법은 무엇입니까?이제 GPT-4o는 매우 강력하며 일반적인 프로그래밍을 수행할 수 있습니다.
win10 시스템에서 C 디스크의 각 디렉터리(숨겨진 파일 포함)의 볼륨 크기에 대한 구체적인 요구 사항은 다음과 같습니다.
C 드라이브의 루트 디렉터리부터 시작하여,
1, 이 디렉토리의 하위 디렉토리가 3개 이상의 레이어인 경우 세 번째 레이어 디렉토리로 확장될 수 있으며, 세 번째 레이어 디렉토리에 포함된 각 디렉토리의 해당 볼륨에 대한 통계가 있습니다.
2, 이 디렉토리의 하위 디렉토리가 3개의 레이어를 초과하지 않는 경우, 해당 볼륨의 디렉토리의 마지막 레이어까지 이 디렉토리의 확장에 대한 통계
t1=tick seconds();run program(executable("cmd.exe"),options({"/c powershell -Command \!"& {$results = @(); Get-ChildItem C:\ -Directory -Force | ForEach-Object { $topDir = $_; $subDirs = Get-ChildItem $topDir.FullName -Recurse -Directory -Force -ErrorAction SilentlyContinue | Where-Object { ($_.FullName.Split('\').Length - 1) -le 3 }; if ($subDirs) { $subDirs | ForEach-Object { $size = (Get-ChildItem $_.FullName -Recurse -File -Force -ErrorAction SilentlyContinue | Measure-Object -Property Length -Sum).Sum; $results += [PSCustomObject]@{ Path = $_.FullName; 'Size (MB)' = [math]::Round($size / 1MB, 2) } } } else { $size = (Get-ChildItem $topDir.FullName -Recurse -File -Force -ErrorAction SilentlyContinue | Measure-Object -Property Length -Sum).Sum; $results += [PSCustomObject]@{ Path = $topDir.FullName; ')' = [math]::Round($size / 1MB, 2) } } }; $results | Export-Csv -Path 'D:\目录大小.csv' -NoTypeInformation -Encoding UTF8}\!""}));
t2=tick seconds();t=t2-t1;Re: JSL을 사용하여 특정 폴더의 볼륨을 직접 가져올 수 있는 방법은 무엇입니까?