Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.

Commit 339a605

Browse files
committed
Set metastore files hidden if possible
1 parent 60db0e6 commit 339a605

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

core/src/plugins/metastore.serial/SerialMetaStore.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,16 +319,18 @@ protected function saveMetaFileData($ajxpNode, $scope, $userId)
319319
}
320320
$writeMode = "w";
321321
$nodeIsWinLocal = false;
322-
if($scope === AJXP_METADATA_SCOPE_GLOBAL && $this->nodeIsLocalWindowsFS($ajxpNode) && file_exists($metaFile)){
322+
if($scope === AJXP_METADATA_SCOPE_GLOBAL && $this->nodeIsLocalWindowsFS($ajxpNode)) {
323323
$nodeIsWinLocal = true;
324-
$writeMode = "rw+";
324+
if (file_exists($metaFile)) {
325+
$writeMode = "rw+";
326+
}
325327
}
326328
$fp = @fopen($metaFile, $writeMode);
327329
if ($fp !== false) {
328330
@fwrite($fp, serialize(self::$fullMetaCache[$metaFile]), strlen(serialize(self::$fullMetaCache[$metaFile])));
329331
@fclose($fp);
330332
if($nodeIsWinLocal){
331-
$real_path_metafile = TextEncoder::toStorageEncoding(realpath(MetaStreamWrapper::getRealFSReference($metaFile)));
333+
$real_path_metafile = realpath(MetaStreamWrapper::getRealFSReference($metaFile));
332334
if (is_dir(dirname($real_path_metafile))) {
333335
StatHelper::winSetHidden($real_path_metafile);
334336
}

0 commit comments

Comments
 (0)