diff --git a/modules/nextflow/src/main/groovy/nextflow/Session.groovy b/modules/nextflow/src/main/groovy/nextflow/Session.groovy index 07792c8787..d9f216bce1 100644 --- a/modules/nextflow/src/main/groovy/nextflow/Session.groovy +++ b/modules/nextflow/src/main/groovy/nextflow/Session.groovy @@ -54,6 +54,7 @@ import nextflow.exception.MissingLibraryException import nextflow.exception.ScriptCompilationException import nextflow.executor.ExecutorFactory import nextflow.extension.CH +import nextflow.extension.FilesEx import nextflow.file.FileHelper import nextflow.file.FilePorter import nextflow.plugin.Plugins @@ -82,7 +83,6 @@ import nextflow.trace.event.TaskEvent import nextflow.trace.event.WorkflowOutputEvent import nextflow.util.Barrier import nextflow.util.ClassLoaderFactory -import nextflow.util.Duration import nextflow.util.HistoryFile import nextflow.util.LoggerHelper import nextflow.util.NameGenerator @@ -445,7 +445,8 @@ class Session implements ISession { */ Session init( ScriptFile scriptFile, List args=null, Map cliParams=null, Map configParams=null ) { - if(!workDir.mkdirs()) throw new AbortOperationException("Cannot create work-dir: $workDir -- Make sure you have write permissions or specify a different directory by using the `-w` command line option") + if(!workDir.mkdirs()) + throw new AbortOperationException("Cannot create work-dir '${FilesEx.toUriString(workDir)}' -- Make sure you have write permissions or specify a different directory by using the `-w` command line option") log.debug "Work-dir: ${workDir.toUriString()} [${FileHelper.getPathFsType(workDir)}]" if( config.bucketDir ) { diff --git a/modules/nf-commons/src/main/nextflow/extension/FilesEx.groovy b/modules/nf-commons/src/main/nextflow/extension/FilesEx.groovy index 6df887b592..3615078987 100644 --- a/modules/nf-commons/src/main/nextflow/extension/FilesEx.groovy +++ b/modules/nf-commons/src/main/nextflow/extension/FilesEx.groovy @@ -495,7 +495,7 @@ class FilesEx { return true } catch(IOException e) { - log.debug "Failed to create directory '$self'", e + log.debug "Failed to create directory '${toUriString(self)}'", e return false } } @@ -515,7 +515,7 @@ class FilesEx { Files.isReadable(self) } catch( IOException e ) { - log.trace("Cannot get read permission on file: $self -- Cause: ${e.getMessage()}") + log.trace("Cannot get read permission on file '${toUriString(self)}' -- Cause: ${e.getMessage()}") return false } } @@ -536,7 +536,7 @@ class FilesEx { Files.isWritable(self) } catch( IOException e ) { - log.trace("Cannot get write permission on file: $self -- Cause: ${e.getMessage()}") + log.trace("Cannot get write permission on file '${toUriString(self)}' -- Cause: ${e.getMessage()}") return false } } @@ -560,7 +560,7 @@ class FilesEx { Files.isExecutable(self) } catch( IOException e ) { - log.trace("Cannot get execute permission on file: $self -- Cause: ${e.getMessage()}") + log.trace("Cannot get execute permission on file '${toUriString(self)}' -- Cause: ${e.getMessage()}") return false } } @@ -590,7 +590,7 @@ class FilesEx { Files.getLastModifiedTime(self,options).toMillis() } catch( IOException e ) { - log.trace "Cannot get lastModified time on file: $self -- Cause: ${e.getMessage()}" + log.trace "Cannot get lastModified time on file '${toUriString(self)}' -- Cause: ${e.getMessage()}" return 0 } }