You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

关于使用Flowgear资源访问文件元数据的可行性及获取文件最后修改时间的技术咨询

How to Get "Last Modified" Metadata for SMB Files in Flowgear Workflows

Great question! I’ve worked with similar Flowgear scenarios involving SMB file filtering, so let’s walk through the solutions that will get you what you need:

1. Use a PowerShell Node to Fetch Last Modified Times (Most Reliable Method)

The built-in Flowgear file nodes like File Enumerator don’t expose the Last Modified metadata directly, but you can easily work around this with a PowerShell node executed via your Droppoint. This lets you query SMB file metadata natively and filter for files modified after your target time.

Here’s a sample script you can drop into the PowerShell node:

# Define your SMB share path and cutoff time (adjust these to your needs)
$smbPath = "\\your-server\your-share\target-folder"
$todayCutoff = Get-Date -Hour 16 -Minute 30 -Second 0 # e.g., 4:30 PM today

# Enumerate files, filter by modified time, and return key details
Get-ChildItem -Path $smbPath -Recurse -File | 
    Where-Object { $_.LastWriteTime -ge $todayCutoff } | 
    Select-Object FullName, LastWriteTime, Name
  • Make sure your Droppoint has read permissions to the SMB share (the Windows user running the Droppoint service needs access).
  • The output of this node will be an array of objects with FullName (full SMB path), LastWriteTime, and Name—you can pass this to subsequent nodes (like Loop + File Manage) to process only the filtered files.

2. Alternative: Use a C# Script Node

If you prefer C# over PowerShell, you can achieve the same result with a C# Script node:

using System.IO;
using System.Collections.Generic;

var smbPath = @"\\your-server\your-share\target-folder";
var cutoffTime = DateTime.Today.AddHours(16).AddMinutes(30); // 4:30 PM today

var matchingFiles = new List<object>();
foreach (var file in Directory.GetFiles(smbPath, "*", SearchOption.AllDirectories))
{
    var lastModified = File.GetLastWriteTime(file);
    if (lastModified >= cutoffTime)
    {
        matchingFiles.Add(new {
            FullPath = file,
            LastModified = lastModified,
            FileName = Path.GetFileName(file)
        });
    }
}

return matchingFiles;

3. Flowgear Resource Access for Metadata?

Unfortunately, Flowgear’s built-in SMB resource connections are primarily designed for basic file operations (read/write/move) and don’t expose file metadata directly. You’ll still need to use the script-based methods above to fetch Last Modified times, even when using a Flowgear resource—just reference the resource’s path in your script instead of hardcoding it if you want to reuse the connection.

Workflow Example Flow

  1. Add a PowerShell/C# Script node to enumerate and filter files by Last Modified time.
  2. Connect the script node’s output to a Loop node to iterate over each matching file.
  3. Inside the Loop, use File Manage/File Read nodes to process each file as needed.

内容的提问来源于stack exchange,提问作者R.D. Alkire

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.30 23:32:29