added directory manipulation to ResourceSink