It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Where does bitbucket store files after export to "C:/temp/" Edited

Hi! I'm working on a project and we are using bitbucket pipelines for the first time. 

We have a project that runs calculations and then exports the results to a CSV file to "C:/temp/". The name of the file is dynamic and bound with the time it ran, but I don't have an issue there.

 

The issue I have is that I want to check the CSV file with a pipeline, meaning that Somewhere on the bitbucket or pipeline (to be honest I don't really know) the file will be also exported to "C:/temp/"... How do I get to this file in the bitbucket or pipeline directory? 

 

Something like:

 

 string[] CSVFiles = Directory.GetFiles("C:/temp/", "*.csv");

 
was my initial idea but this seems to fail. 

 

The stacktrace it gives is: 

System.IO.DirectoryNotFoundException : Could not find a part of the path '/opt/atlassian/pipelines/agent/build/SMLDC.Tests/bin/Debug/netcoreapp3.0/C:/temp'.  Stack Trace:     
at System.IO.Enumeration.FileSystemEnumerator`1.CreateDirectoryHandle(String path, Boolean ignoreNotFound)

at System.IO.Enumeration.FileSystemEnumerator`1.Init()

at System.IO.Enumeration.FileSystemEnumerator`1..ctor(String directory, Boolean isNormalized, EnumerationOptions options)

at System.IO.Enumeration.FileSystemEnumerable`1..ctor(String directory, FindTransform transform, EnumerationOptions options, Boolean isNormalized)

at System.IO.Enumeration.FileSystemEnumerableFactory.UserFiles(String directory, String expression, EnumerationOptions options)

at System.IO.Directory.InternalEnumeratePaths(String path, String searchPattern, SearchTarget searchTarget, EnumerationOptions options)

at System.IO.Directory.GetFiles(String path, String searchPattern)

at SMLDC.Tests.IntegrationTest.Setup() in /opt/atlassian/pipelines/agent/build/SMLDC.Tests/IntegrationTest.cs:line 31

 

1 answer

1 accepted

0 votes
Answer accepted

Found my answer! 

Bitbucket is apparently (duh) linux based... so it will never store in a windows based path.

 

changed to a linux path after a Enviroment.OSVersion.Platform check and it works.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket Pipelines

What We Learned When We Researched Open Source Vulnerabilities in 7 Popular Coding Languages

...hey are a part of us, shaping how we interact with the world around us. The same holds true for programming languages when we think about how different kinds of vulnerabilities raise their heads in t...

1,049 views 0 3
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you