Permalink
Browse files

Set metastore files hidden if possible

  • Loading branch information...
1 parent 60db0e6 commit 339a6056ce791c9f5bf93a580d10671bab535262 @Nanomani Nanomani committed Sep 29, 2016
Showing with 5 additions and 3 deletions.
  1. +5 −3 core/src/plugins/metastore.serial/SerialMetaStore.php
@@ -319,16 +319,18 @@ protected function saveMetaFileData($ajxpNode, $scope, $userId)
}
$writeMode = "w";
$nodeIsWinLocal = false;
- if($scope === AJXP_METADATA_SCOPE_GLOBAL && $this->nodeIsLocalWindowsFS($ajxpNode) && file_exists($metaFile)){
+ if($scope === AJXP_METADATA_SCOPE_GLOBAL && $this->nodeIsLocalWindowsFS($ajxpNode)) {
$nodeIsWinLocal = true;
- $writeMode = "rw+";
+ if (file_exists($metaFile)) {
+ $writeMode = "rw+";
+ }
}
$fp = @fopen($metaFile, $writeMode);
if ($fp !== false) {
@fwrite($fp, serialize(self::$fullMetaCache[$metaFile]), strlen(serialize(self::$fullMetaCache[$metaFile])));
@fclose($fp);
if($nodeIsWinLocal){
- $real_path_metafile = TextEncoder::toStorageEncoding(realpath(MetaStreamWrapper::getRealFSReference($metaFile)));
+ $real_path_metafile = realpath(MetaStreamWrapper::getRealFSReference($metaFile));
if (is_dir(dirname($real_path_metafile))) {
StatHelper::winSetHidden($real_path_metafile);
}

0 comments on commit 339a605

Please sign in to comment.