summaryrefslogtreecommitdiffstats
path: root/src/vfs/fish/helpers/utime
diff options
context:
space:
mode:
Diffstat (limited to 'src/vfs/fish/helpers/utime')
-rw-r--r--src/vfs/fish/helpers/utime13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/vfs/fish/helpers/utime b/src/vfs/fish/helpers/utime
new file mode 100644
index 0000000..94395b4
--- /dev/null
+++ b/src/vfs/fish/helpers/utime
@@ -0,0 +1,13 @@
+#UTIME "$FISH_TOUCHATIME_W_NSEC" "$FISH_TOUCHMTIME_W_NSEC" "$FISH_FILENAME"
+if TZ=UTC touch -h -m -d "$FISH_TOUCHMTIME_W_NSEC" "/${FISH_FILENAME}" 2>/dev/null && \
+ TZ=UTC touch -h -a -d "$FISH_TOUCHATIME_W_NSEC" "/${FISH_FILENAME}" 2>/dev/null; then
+ echo "### 000"
+elif TZ=UTC touch -h -m -t $FISH_TOUCHMTIME "/${FISH_FILENAME}" 2>/dev/null && \
+ TZ=UTC touch -h -a -t $FISH_TOUCHATIME "/${FISH_FILENAME}" 2>/dev/null; then
+ echo "### 000"
+elif [ -n "$FISH_HAVE_PERL" ] &&
+ perl -e 'utime '$FISH_FILEATIME','$FISH_FILEMTIME',@ARGV;' "/${FISH_FILENAME}" 2>/dev/null; then
+ echo "### 000"
+else
+ echo "### 500"
+fi